baremetalinfrastructure release (#25954)
https://github.com/Azure/sdk-release-request/issues/4183
This commit is contained in:
Родитель
0b562547ae
Коммит
02e3fc08a6
|
@ -37,6 +37,7 @@ specifiers:
|
|||
'@rush-temp/arm-azureadexternalidentities': file:./projects/arm-azureadexternalidentities.tgz
|
||||
'@rush-temp/arm-azurestack': file:./projects/arm-azurestack.tgz
|
||||
'@rush-temp/arm-azurestackhci': file:./projects/arm-azurestackhci.tgz
|
||||
'@rush-temp/arm-baremetalinfrastructure': file:./projects/arm-baremetalinfrastructure.tgz
|
||||
'@rush-temp/arm-batch': file:./projects/arm-batch.tgz
|
||||
'@rush-temp/arm-billing': file:./projects/arm-billing.tgz
|
||||
'@rush-temp/arm-billingbenefits': file:./projects/arm-billingbenefits.tgz
|
||||
|
@ -380,6 +381,7 @@ dependencies:
|
|||
'@rush-temp/arm-azureadexternalidentities': file:projects/arm-azureadexternalidentities.tgz
|
||||
'@rush-temp/arm-azurestack': file:projects/arm-azurestack.tgz
|
||||
'@rush-temp/arm-azurestackhci': file:projects/arm-azurestackhci.tgz
|
||||
'@rush-temp/arm-baremetalinfrastructure': file:projects/arm-baremetalinfrastructure.tgz
|
||||
'@rush-temp/arm-batch': file:projects/arm-batch.tgz
|
||||
'@rush-temp/arm-billing': file:projects/arm-billing.tgz
|
||||
'@rush-temp/arm-billingbenefits': file:projects/arm-billingbenefits.tgz
|
||||
|
@ -10126,6 +10128,34 @@ packages:
|
|||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/arm-baremetalinfrastructure.tgz:
|
||||
resolution: {integrity: sha512-p26E+Kk/8NcMCgcqFRQwq6lHw30GJroePEITUPoeaqNn4Yjh7FyKmZUXgg5LF+NzoJzGmnEI73acrnTxeDRy7g==, tarball: file:projects/arm-baremetalinfrastructure.tgz}
|
||||
name: '@rush-temp/arm-baremetalinfrastructure'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
'@azure/identity': 2.1.0
|
||||
'@microsoft/api-extractor': 7.35.0_@types+node@14.18.47
|
||||
'@rollup/plugin-commonjs': 24.1.0_rollup@2.79.1
|
||||
'@rollup/plugin-json': 6.0.0_rollup@2.79.1
|
||||
'@rollup/plugin-multi-entry': 6.0.0_rollup@2.79.1
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1
|
||||
'@types/chai': 4.3.5
|
||||
'@types/node': 14.18.47
|
||||
chai: 4.3.7
|
||||
cross-env: 7.0.3
|
||||
dotenv: 16.0.3
|
||||
mkdirp: 2.1.6
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.79.1
|
||||
rollup-plugin-sourcemaps: 0.6.3_ehqevut6loiv2j3zjuhqc62mru
|
||||
tslib: 2.5.2
|
||||
typescript: 5.0.4
|
||||
uglify-js: 3.17.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
file:projects/arm-batch.tgz:
|
||||
resolution: {integrity: sha512-2fxbZvesjWy2JPLb6VHPHvCwsZ75ahGZ4aAwTBIWrgTzUUuzHuAit+FCkuYC8ohoyoMgspiLhJqygMy12pDQ9A==, tarball: file:projects/arm-batch.tgz}
|
||||
name: '@rush-temp/arm-batch'
|
||||
|
|
|
@ -15,3 +15,5 @@ https://docs.microsoft.com/javascript/api/@azure/arm-selfhelp?view=azure-node-pr
|
|||
https://docs.microsoft.com/javascript/api/@azure/arm-costmanagement?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-costmanagement
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-networkcloud?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-baremetalinfrastructure
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-baremetalinfrastructure?view=azure-node-preview
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* This is the main configuration file for Rush.
|
||||
* For full documentation, please see https://rushjs.io
|
||||
*/ {
|
||||
*/{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json",
|
||||
/**
|
||||
* (Required) This specifies the version of the Rush engine to be used in this repo.
|
||||
|
@ -1997,6 +1997,11 @@
|
|||
"packageName": "@azure/arm-networkcloud",
|
||||
"projectFolder": "sdk/networkcloud/arm-networkcloud",
|
||||
"versionPolicyName": "management"
|
||||
},
|
||||
{
|
||||
"packageName": "@azure/arm-baremetalinfrastructure",
|
||||
"projectFolder": "sdk/baremetalinfrastructure/arm-baremetalinfrastructure",
|
||||
"versionPolicyName": "management"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
# Release History
|
||||
|
||||
## 1.0.0-beta.1 (2023-05-23)
|
||||
|
||||
The package of @azure/arm-baremetalinfrastructure 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) 2023 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 bareMetalInfrastructure client library for JavaScript
|
||||
|
||||
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure bareMetalInfrastructure client.
|
||||
|
||||
The BareMetalInfrastructure Management client
|
||||
|
||||
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure) |
|
||||
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-baremetalinfrastructure) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-baremetalinfrastructure) |
|
||||
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
||||
|
||||
## Getting started
|
||||
|
||||
### Currently supported environments
|
||||
|
||||
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
||||
- Latest versions of Safari, Chrome, Edge and Firefox.
|
||||
|
||||
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- An [Azure subscription][azure_sub].
|
||||
|
||||
### Install the `@azure/arm-baremetalinfrastructure` package
|
||||
|
||||
Install the Azure bareMetalInfrastructure client library for JavaScript with `npm`:
|
||||
|
||||
```bash
|
||||
npm install @azure/arm-baremetalinfrastructure
|
||||
```
|
||||
|
||||
### Create and authenticate a `BareMetalInfrastructureClient`
|
||||
|
||||
To create a client object to access the Azure bareMetalInfrastructure API, you will need the `endpoint` of your Azure bareMetalInfrastructure resource and a `credential`. The Azure bareMetalInfrastructure client can use Azure Active Directory credentials to authenticate.
|
||||
You can find the endpoint for your Azure bareMetalInfrastructure 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 bareMetalInfrastructure** 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 { BareMetalInfrastructureClient } = require("@azure/arm-baremetalinfrastructure");
|
||||
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 BareMetalInfrastructureClient(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 BareMetalInfrastructureClient(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
|
||||
|
||||
### BareMetalInfrastructureClient
|
||||
|
||||
`BareMetalInfrastructureClient` is the primary interface for developers using the Azure bareMetalInfrastructure client library. Explore the methods on this client object to understand the different features of the Azure bareMetalInfrastructure 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%2Fbaremetalinfrastructure%2Farm-baremetalinfrastructure%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": "52fe50208e2c06b93c50c912bc1b20e3e83b749b",
|
||||
"readme": "specification/baremetalinfrastructure/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.9.3 --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\\baremetalinfrastructure\\resource-manager\\readme.md --use=@autorest/typescript@6.0.2 --generate-sample=true",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.2",
|
||||
"use": "@autorest/typescript@6.0.2"
|
||||
}
|
|
@ -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-baremetalinfrastructure.d.ts"
|
||||
},
|
||||
"messages": {
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
"extractorMessageReporting": {
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
"ae-unresolved-link": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"AssetsRepo": "Azure/azure-sdk-assets",
|
||||
"AssetsRepoPrefixPath": "js",
|
||||
"TagPrefix": "js/baremetalinfrastructure/arm-baremetalinfrastructure",
|
||||
"Tag": "js/baremetalinfrastructure/arm-baremetalinfrastructure_7391ca6030"
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
{
|
||||
"name": "@azure/arm-baremetalinfrastructure",
|
||||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for BareMetalInfrastructureClient.",
|
||||
"version": "1.0.0-beta.1",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-client": "^1.7.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-baremetalinfrastructure.d.ts",
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.31.1",
|
||||
"@rollup/plugin-commonjs": "^24.0.0",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@rollup/plugin-multi-entry": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"mkdirp": "^2.1.2",
|
||||
"rollup": "^2.66.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"typescript": "~5.0.0",
|
||||
"uglify-js": "^3.4.9",
|
||||
"rimraf": "^3.0.0",
|
||||
"dotenv": "^16.0.0",
|
||||
"@azure/identity": "^2.0.1",
|
||||
"@azure-tools/test-recorder": "^3.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",
|
||||
"@types/node": "^14.0.0",
|
||||
"@azure/dev-tool": "^1.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*.js",
|
||||
"dist/**/*.js.map",
|
||||
"dist/**/*.d.ts",
|
||||
"dist/**/*.d.ts.map",
|
||||
"dist-esm/**/*.js",
|
||||
"dist-esm/**/*.js.map",
|
||||
"dist-esm/**/*.d.ts",
|
||||
"dist-esm/**/*.d.ts.map",
|
||||
"src/**/*.ts",
|
||||
"README.md",
|
||||
"LICENSE",
|
||||
"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/bareMetalInfrastructureClient.ts",
|
||||
"prefix": "packageDetails"
|
||||
}
|
||||
]
|
||||
},
|
||||
"autoPublish": true,
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure",
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
],
|
||||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-baremetalinfrastructure?view=azure-node-preview"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,325 @@
|
|||
## API Report File for "@azure/arm-baremetalinfrastructure"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
|
||||
import * as coreAuth from '@azure/core-auth';
|
||||
import * as coreClient from '@azure/core-client';
|
||||
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalHardwareTypeNamesEnum = string;
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstance extends TrackedResource {
|
||||
readonly azureBareMetalInstanceId?: string;
|
||||
hardwareProfile?: HardwareProfile;
|
||||
readonly hwRevision?: string;
|
||||
networkProfile?: NetworkProfile;
|
||||
osProfile?: OSProfile;
|
||||
partnerNodeId?: string;
|
||||
readonly powerState?: AzureBareMetalInstancePowerStateEnum;
|
||||
readonly provisioningState?: AzureBareMetalProvisioningStatesEnum;
|
||||
readonly proximityPlacementGroup?: string;
|
||||
storageProfile?: StorageProfile;
|
||||
readonly systemData?: SystemData;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstancePowerStateEnum = string;
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstances {
|
||||
get(resourceGroupName: string, azureBareMetalInstanceName: string, options?: AzureBareMetalInstancesGetOptionalParams): Promise<AzureBareMetalInstancesGetResponse>;
|
||||
listByResourceGroup(resourceGroupName: string, options?: AzureBareMetalInstancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator<AzureBareMetalInstance>;
|
||||
listBySubscription(options?: AzureBareMetalInstancesListBySubscriptionOptionalParams): PagedAsyncIterableIterator<AzureBareMetalInstance>;
|
||||
update(resourceGroupName: string, azureBareMetalInstanceName: string, tagsParameter: Tags, options?: AzureBareMetalInstancesUpdateOptionalParams): Promise<AzureBareMetalInstancesUpdateResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstancesGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstancesGetResponse = AzureBareMetalInstance;
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstanceSizeNamesEnum = string;
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstancesListByResourceGroupNextResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstancesListByResourceGroupOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstancesListByResourceGroupResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstancesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstancesListBySubscriptionNextResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstancesListBySubscriptionOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstancesListBySubscriptionResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstancesListResult {
|
||||
nextLink?: string;
|
||||
value?: AzureBareMetalInstance[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface AzureBareMetalInstancesUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalInstancesUpdateResponse = AzureBareMetalInstance;
|
||||
|
||||
// @public
|
||||
export type AzureBareMetalProvisioningStatesEnum = string;
|
||||
|
||||
// @public (undocumented)
|
||||
export class BareMetalInfrastructureClient extends coreClient.ServiceClient {
|
||||
// (undocumented)
|
||||
$host: string;
|
||||
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: BareMetalInfrastructureClientOptionalParams);
|
||||
// (undocumented)
|
||||
apiVersion: string;
|
||||
// (undocumented)
|
||||
azureBareMetalInstances: AzureBareMetalInstances;
|
||||
// (undocumented)
|
||||
operations: Operations;
|
||||
// (undocumented)
|
||||
subscriptionId: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface BareMetalInfrastructureClientOptionalParams extends coreClient.ServiceClientOptions {
|
||||
$host?: string;
|
||||
apiVersion?: string;
|
||||
endpoint?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type CreatedByType = string;
|
||||
|
||||
// @public
|
||||
export interface Disk {
|
||||
diskSizeGB?: number;
|
||||
readonly lun?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Display {
|
||||
readonly description?: string;
|
||||
readonly operation?: string;
|
||||
readonly provider?: string;
|
||||
readonly resource?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ErrorDefinition {
|
||||
readonly code?: string;
|
||||
readonly details?: ErrorDefinition[];
|
||||
readonly message?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ErrorResponse {
|
||||
error?: ErrorDefinition;
|
||||
}
|
||||
|
||||
// @public
|
||||
export function getContinuationToken(page: unknown): string | undefined;
|
||||
|
||||
// @public
|
||||
export interface HardwareProfile {
|
||||
readonly azureBareMetalInstanceSize?: AzureBareMetalInstanceSizeNamesEnum;
|
||||
readonly hardwareType?: AzureBareMetalHardwareTypeNamesEnum;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface IpAddress {
|
||||
ipAddress?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownAzureBareMetalHardwareTypeNamesEnum {
|
||||
CiscoUCS = "Cisco_UCS",
|
||||
HPE = "HPE"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownAzureBareMetalInstancePowerStateEnum {
|
||||
Restarting = "restarting",
|
||||
Started = "started",
|
||||
Starting = "starting",
|
||||
Stopped = "stopped",
|
||||
Stopping = "stopping",
|
||||
Unknown = "unknown"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownAzureBareMetalInstanceSizeNamesEnum {
|
||||
S112 = "S112",
|
||||
S144 = "S144",
|
||||
S144M = "S144m",
|
||||
S192 = "S192",
|
||||
S192M = "S192m",
|
||||
S192Xm = "S192xm",
|
||||
S224 = "S224",
|
||||
S224M = "S224m",
|
||||
S224Om = "S224om",
|
||||
S224Oo = "S224oo",
|
||||
S224Oom = "S224oom",
|
||||
S224Ooo = "S224ooo",
|
||||
S384 = "S384",
|
||||
S384M = "S384m",
|
||||
S384Xm = "S384xm",
|
||||
S384Xxm = "S384xxm",
|
||||
S448 = "S448",
|
||||
S448M = "S448m",
|
||||
S448Om = "S448om",
|
||||
S448Oo = "S448oo",
|
||||
S448Oom = "S448oom",
|
||||
S448Ooo = "S448ooo",
|
||||
S576M = "S576m",
|
||||
S576Xm = "S576xm",
|
||||
S672 = "S672",
|
||||
S672M = "S672m",
|
||||
S672Om = "S672om",
|
||||
S672Oo = "S672oo",
|
||||
S672Oom = "S672oom",
|
||||
S672Ooo = "S672ooo",
|
||||
S72 = "S72",
|
||||
S72M = "S72m",
|
||||
S768 = "S768",
|
||||
S768M = "S768m",
|
||||
S768Xm = "S768xm",
|
||||
S896 = "S896",
|
||||
S896M = "S896m",
|
||||
S896Om = "S896om",
|
||||
S896Oo = "S896oo",
|
||||
S896Oom = "S896oom",
|
||||
S896Ooo = "S896ooo",
|
||||
S96 = "S96",
|
||||
S960M = "S960m"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownAzureBareMetalProvisioningStatesEnum {
|
||||
Accepted = "Accepted",
|
||||
Creating = "Creating",
|
||||
Deleting = "Deleting",
|
||||
Failed = "Failed",
|
||||
Migrating = "Migrating",
|
||||
Succeeded = "Succeeded",
|
||||
Updating = "Updating"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownCreatedByType {
|
||||
Application = "Application",
|
||||
Key = "Key",
|
||||
ManagedIdentity = "ManagedIdentity",
|
||||
User = "User"
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface NetworkProfile {
|
||||
readonly circuitId?: string;
|
||||
networkInterfaces?: IpAddress[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Operation {
|
||||
display?: Display;
|
||||
readonly isDataAction?: boolean;
|
||||
readonly name?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationList {
|
||||
value?: Operation[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Operations {
|
||||
list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<Operation>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationsListOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type OperationsListResponse = OperationList;
|
||||
|
||||
// @public
|
||||
export interface OSProfile {
|
||||
computerName?: string;
|
||||
readonly osType?: string;
|
||||
sshPublicKey?: string;
|
||||
readonly version?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Resource {
|
||||
readonly id?: string;
|
||||
readonly name?: string;
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Result {
|
||||
sampleProperty?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface StorageProfile {
|
||||
readonly nfsIpAddress?: string;
|
||||
osDisks?: Disk[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface SystemData {
|
||||
createdAt?: Date;
|
||||
createdBy?: string;
|
||||
createdByType?: CreatedByType;
|
||||
lastModifiedAt?: Date;
|
||||
lastModifiedBy?: string;
|
||||
lastModifiedByType?: CreatedByType;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Tags {
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface TrackedResource extends Resource {
|
||||
location: string;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
}
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
```
|
|
@ -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,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 { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_Get.json
|
||||
*/
|
||||
async function getAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myAzureBareMetalInstance";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.get(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAnAzureBareMetalInstance();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListByResourceGroup.json
|
||||
*/
|
||||
async function listAllAzureBareMetalInstancesInAResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.azureBareMetalInstances.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllAzureBareMetalInstancesInAResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListBySubscription.json
|
||||
*/
|
||||
async function listAllAzureBareMetalInstancesInASubscription() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.azureBareMetalInstances.listBySubscription()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllAzureBareMetalInstancesInASubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 {
|
||||
Tags,
|
||||
BareMetalInfrastructureClient
|
||||
} from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags_Delete.json
|
||||
*/
|
||||
async function deleteTagsFieldOfAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myABMInstance";
|
||||
const tagsParameter: Tags = { tags: {} };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.update(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName,
|
||||
tagsParameter
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags.json
|
||||
*/
|
||||
async function updateTagsFieldOfAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myABMInstance";
|
||||
const tagsParameter: Tags = { tags: { testkey: "testvalue" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.update(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName,
|
||||
tagsParameter
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteTagsFieldOfAnAzureBareMetalInstance();
|
||||
updateTagsFieldOfAnAzureBareMetalInstance();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal management operations.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal management operations.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalOperations_List.json
|
||||
*/
|
||||
async function listAllManagementOperationsSupportedByTheAzureBareMetalRp() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllManagementOperationsSupportedByTheAzureBareMetalRp();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,58 @@
|
|||
# client library samples for JavaScript
|
||||
|
||||
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [azureBareMetalInstancesGetSample.js][azurebaremetalinstancesgetsample] | Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_Get.json |
|
||||
| [azureBareMetalInstancesListByResourceGroupSample.js][azurebaremetalinstanceslistbyresourcegroupsample] | Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListByResourceGroup.json |
|
||||
| [azureBareMetalInstancesListBySubscriptionSample.js][azurebaremetalinstanceslistbysubscriptionsample] | Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListBySubscription.json |
|
||||
| [azureBareMetalInstancesUpdateSample.js][azurebaremetalinstancesupdatesample] | Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags_Delete.json |
|
||||
| [operationsListSample.js][operationslistsample] | Gets a list of AzureBareMetal management operations. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalOperations_List.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node azureBareMetalInstancesGetSample.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 BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID="<baremetalinfrastructure subscription id>" BAREMETALINFRASTRUCTURE_RESOURCE_GROUP="<baremetalinfrastructure resource group>" node azureBareMetalInstancesGetSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[azurebaremetalinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/javascript/azureBareMetalInstancesGetSample.js
|
||||
[azurebaremetalinstanceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/javascript/azureBareMetalInstancesListByResourceGroupSample.js
|
||||
[azurebaremetalinstanceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/javascript/azureBareMetalInstancesListBySubscriptionSample.js
|
||||
[azurebaremetalinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/javascript/azureBareMetalInstancesUpdateSample.js
|
||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/javascript/operationsListSample.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-baremetalinfrastructure?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/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 { BareMetalInfrastructureClient } = require("@azure/arm-baremetalinfrastructure");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_Get.json
|
||||
*/
|
||||
async function getAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myAzureBareMetalInstance";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.get(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAnAzureBareMetalInstance();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { BareMetalInfrastructureClient } = require("@azure/arm-baremetalinfrastructure");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListByResourceGroup.json
|
||||
*/
|
||||
async function listAllAzureBareMetalInstancesInAResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.azureBareMetalInstances.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllAzureBareMetalInstancesInAResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { BareMetalInfrastructureClient } = require("@azure/arm-baremetalinfrastructure");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListBySubscription.json
|
||||
*/
|
||||
async function listAllAzureBareMetalInstancesInASubscription() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.azureBareMetalInstances.listBySubscription()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllAzureBareMetalInstancesInASubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 { BareMetalInfrastructureClient } = require("@azure/arm-baremetalinfrastructure");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags_Delete.json
|
||||
*/
|
||||
async function deleteTagsFieldOfAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myABMInstance";
|
||||
const tagsParameter = { tags: {} };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.update(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName,
|
||||
tagsParameter
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags.json
|
||||
*/
|
||||
async function updateTagsFieldOfAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myABMInstance";
|
||||
const tagsParameter = { tags: { testkey: "testvalue" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.update(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName,
|
||||
tagsParameter
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteTagsFieldOfAnAzureBareMetalInstance();
|
||||
updateTagsFieldOfAnAzureBareMetalInstance();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { BareMetalInfrastructureClient } = require("@azure/arm-baremetalinfrastructure");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal management operations.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal management operations.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalOperations_List.json
|
||||
*/
|
||||
async function listAllManagementOperationsSupportedByTheAzureBareMetalRp() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllManagementOperationsSupportedByTheAzureBareMetalRp();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-baremetalinfrastructure-js",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for JavaScript",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/baremetalinfrastructure/arm-baremetalinfrastructure"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure",
|
||||
"dependencies": {
|
||||
"@azure/arm-baremetalinfrastructure": "latest",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,71 @@
|
|||
# client library samples for TypeScript
|
||||
|
||||
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
|
||||
|
||||
| **File Name** | **Description** |
|
||||
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [azureBareMetalInstancesGetSample.ts][azurebaremetalinstancesgetsample] | Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_Get.json |
|
||||
| [azureBareMetalInstancesListByResourceGroupSample.ts][azurebaremetalinstanceslistbyresourcegroupsample] | Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListByResourceGroup.json |
|
||||
| [azureBareMetalInstancesListBySubscriptionSample.ts][azurebaremetalinstanceslistbysubscriptionsample] | Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListBySubscription.json |
|
||||
| [azureBareMetalInstancesUpdateSample.ts][azurebaremetalinstancesupdatesample] | Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags_Delete.json |
|
||||
| [operationsListSample.ts][operationslistsample] | Gets a list of AzureBareMetal management operations. x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalOperations_List.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
|
||||
|
||||
```bash
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Compile the samples:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dist/azureBareMetalInstancesGetSample.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 BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID="<baremetalinfrastructure subscription id>" BAREMETALINFRASTRUCTURE_RESOURCE_GROUP="<baremetalinfrastructure resource group>" node dist/azureBareMetalInstancesGetSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[azurebaremetalinstancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/typescript/src/azureBareMetalInstancesGetSample.ts
|
||||
[azurebaremetalinstanceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/typescript/src/azureBareMetalInstancesListByResourceGroupSample.ts
|
||||
[azurebaremetalinstanceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/typescript/src/azureBareMetalInstancesListBySubscriptionSample.ts
|
||||
[azurebaremetalinstancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/typescript/src/azureBareMetalInstancesUpdateSample.ts
|
||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/samples/v1/typescript/src/operationsListSample.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-baremetalinfrastructure?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-baremetalinfrastructure-ts",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for TypeScript",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prebuild": "rimraf dist/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/baremetalinfrastructure/arm-baremetalinfrastructure"
|
||||
},
|
||||
"keywords": [
|
||||
"node",
|
||||
"azure",
|
||||
"typescript",
|
||||
"browser",
|
||||
"isomorphic"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/baremetalinfrastructure/arm-baremetalinfrastructure",
|
||||
"dependencies": {
|
||||
"@azure/arm-baremetalinfrastructure": "latest",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.0.0",
|
||||
"typescript": "~5.0.0",
|
||||
"rimraf": "latest"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -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 { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_Get.json
|
||||
*/
|
||||
async function getAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myAzureBareMetalInstance";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.get(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getAnAzureBareMetalInstance();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal instances in the specified subscription and resource group. The operations returns various properties of each Azure BareMetal instance.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListByResourceGroup.json
|
||||
*/
|
||||
async function listAllAzureBareMetalInstancesInAResourceGroup() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.azureBareMetalInstances.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllAzureBareMetalInstancesInAResourceGroup();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal instances in the specified subscription. The operations returns various properties of each Azure BareMetal instance.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_ListBySubscription.json
|
||||
*/
|
||||
async function listAllAzureBareMetalInstancesInASubscription() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.azureBareMetalInstances.listBySubscription()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllAzureBareMetalInstancesInASubscription();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 {
|
||||
Tags,
|
||||
BareMetalInfrastructureClient
|
||||
} from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags_Delete.json
|
||||
*/
|
||||
async function deleteTagsFieldOfAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myABMInstance";
|
||||
const tagsParameter: Tags = { tags: {} };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.update(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName,
|
||||
tagsParameter
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
*
|
||||
* @summary Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalInstances_PatchTags.json
|
||||
*/
|
||||
async function updateTagsFieldOfAnAzureBareMetalInstance() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"f0f4887f-d13c-4943-a8ba-d7da28d2a3fd";
|
||||
const resourceGroupName =
|
||||
process.env["BAREMETALINFRASTRUCTURE_RESOURCE_GROUP"] || "myResourceGroup";
|
||||
const azureBareMetalInstanceName = "myABMInstance";
|
||||
const tagsParameter: Tags = { tags: { testkey: "testvalue" } };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const result = await client.azureBareMetalInstances.update(
|
||||
resourceGroupName,
|
||||
azureBareMetalInstanceName,
|
||||
tagsParameter
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
deleteTagsFieldOfAnAzureBareMetalInstance();
|
||||
updateTagsFieldOfAnAzureBareMetalInstance();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { BareMetalInfrastructureClient } from "@azure/arm-baremetalinfrastructure";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of AzureBareMetal management operations.
|
||||
*
|
||||
* @summary Gets a list of AzureBareMetal management operations.
|
||||
* x-ms-original-file: specification/baremetalinfrastructure/resource-manager/Microsoft.BareMetalInfrastructure/stable/2021-08-09/examples/AzureBareMetalOperations_List.json
|
||||
*/
|
||||
async function listAllManagementOperationsSupportedByTheAzureBareMetalRp() {
|
||||
const subscriptionId =
|
||||
process.env["BAREMETALINFRASTRUCTURE_SUBSCRIPTION_ID"] ||
|
||||
"00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new BareMetalInfrastructureClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
listAllManagementOperationsSupportedByTheAzureBareMetalRp();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": [
|
||||
"src/**.ts"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 * as coreClient from "@azure/core-client";
|
||||
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
||||
import {
|
||||
PipelineRequest,
|
||||
PipelineResponse,
|
||||
SendRequest
|
||||
} from "@azure/core-rest-pipeline";
|
||||
import * as coreAuth from "@azure/core-auth";
|
||||
import { AzureBareMetalInstancesImpl, OperationsImpl } from "./operations";
|
||||
import { AzureBareMetalInstances, Operations } from "./operationsInterfaces";
|
||||
import { BareMetalInfrastructureClientOptionalParams } from "./models";
|
||||
|
||||
export class BareMetalInfrastructureClient extends coreClient.ServiceClient {
|
||||
$host: string;
|
||||
apiVersion: string;
|
||||
subscriptionId: string;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the BareMetalInfrastructureClient class.
|
||||
* @param credentials Subscription credentials which uniquely identify client subscription.
|
||||
* @param subscriptionId The ID of the target subscription.
|
||||
* @param options The parameter options
|
||||
*/
|
||||
constructor(
|
||||
credentials: coreAuth.TokenCredential,
|
||||
subscriptionId: string,
|
||||
options?: BareMetalInfrastructureClientOptionalParams
|
||||
) {
|
||||
if (credentials === undefined) {
|
||||
throw new Error("'credentials' cannot be null");
|
||||
}
|
||||
if (subscriptionId === undefined) {
|
||||
throw new Error("'subscriptionId' cannot be null");
|
||||
}
|
||||
|
||||
// Initializing default values for options
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
const defaults: BareMetalInfrastructureClientOptionalParams = {
|
||||
requestContentType: "application/json; charset=utf-8",
|
||||
credential: credentials
|
||||
};
|
||||
|
||||
const packageDetails = `azsdk-js-arm-baremetalinfrastructure/1.0.0-beta.1`;
|
||||
const userAgentPrefix =
|
||||
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
||||
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
||||
: `${packageDetails}`;
|
||||
|
||||
const optionsWithDefaults = {
|
||||
...defaults,
|
||||
...options,
|
||||
userAgentOptions: {
|
||||
userAgentPrefix
|
||||
},
|
||||
endpoint:
|
||||
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
||||
};
|
||||
super(optionsWithDefaults);
|
||||
|
||||
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
||||
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
||||
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
||||
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
||||
(pipelinePolicy) =>
|
||||
pipelinePolicy.name ===
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
);
|
||||
}
|
||||
if (
|
||||
!options ||
|
||||
!options.pipeline ||
|
||||
options.pipeline.getOrderedPolicies().length == 0 ||
|
||||
!bearerTokenAuthenticationPolicyFound
|
||||
) {
|
||||
this.pipeline.removePolicy({
|
||||
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
});
|
||||
this.pipeline.addPolicy(
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
||||
credential: credentials,
|
||||
scopes:
|
||||
optionsWithDefaults.credentialScopes ??
|
||||
`${optionsWithDefaults.endpoint}/.default`,
|
||||
challengeCallbacks: {
|
||||
authorizeRequestOnChallenge:
|
||||
coreClient.authorizeRequestOnClaimChallenge
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
// Parameter assignments
|
||||
this.subscriptionId = subscriptionId;
|
||||
|
||||
// Assigning values to Constant parameters
|
||||
this.$host = options.$host || "https://management.azure.com";
|
||||
this.apiVersion = options.apiVersion || "2021-08-09";
|
||||
this.azureBareMetalInstances = new AzureBareMetalInstancesImpl(this);
|
||||
this.operations = new OperationsImpl(this);
|
||||
this.addCustomApiVersionPolicy(options.apiVersion);
|
||||
}
|
||||
|
||||
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
||||
private addCustomApiVersionPolicy(apiVersion?: string) {
|
||||
if (!apiVersion) {
|
||||
return;
|
||||
}
|
||||
const apiVersionPolicy = {
|
||||
name: "CustomApiVersionPolicy",
|
||||
async sendRequest(
|
||||
request: PipelineRequest,
|
||||
next: SendRequest
|
||||
): Promise<PipelineResponse> {
|
||||
const param = request.url.split("?");
|
||||
if (param.length > 1) {
|
||||
const newParams = param[1].split("&").map((item) => {
|
||||
if (item.indexOf("api-version") > -1) {
|
||||
return "api-version=" + apiVersion;
|
||||
} else {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
request.url = param[0] + "?" + newParams.join("&");
|
||||
}
|
||||
return next(request);
|
||||
}
|
||||
};
|
||||
this.pipeline.addPolicy(apiVersionPolicy);
|
||||
}
|
||||
|
||||
azureBareMetalInstances: AzureBareMetalInstances;
|
||||
operations: Operations;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
export { getContinuationToken } from "./pagingHelper";
|
||||
export * from "./models";
|
||||
export { BareMetalInfrastructureClient } from "./bareMetalInfrastructureClient";
|
||||
export * from "./operationsInterfaces";
|
|
@ -0,0 +1,566 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 * as coreClient from "@azure/core-client";
|
||||
|
||||
/** The response from the List AzureBareMetal Instances operation. */
|
||||
export interface AzureBareMetalInstancesListResult {
|
||||
/** The list of Azure BareMetal instances. */
|
||||
value?: AzureBareMetalInstance[];
|
||||
/** The URL to get the next set of AzureBareMetal instances. */
|
||||
nextLink?: string;
|
||||
}
|
||||
|
||||
/** Specifies the hardware settings for the AzureBareMetal instance. */
|
||||
export interface HardwareProfile {
|
||||
/**
|
||||
* Name of the hardware type (vendor and/or their product name)
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly hardwareType?: AzureBareMetalHardwareTypeNamesEnum;
|
||||
/**
|
||||
* Specifies the AzureBareMetal instance SKU.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly azureBareMetalInstanceSize?: AzureBareMetalInstanceSizeNamesEnum;
|
||||
}
|
||||
|
||||
/** Specifies the storage settings for the AzureBareMetal instance disks. */
|
||||
export interface StorageProfile {
|
||||
/**
|
||||
* IP Address to connect to storage.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly nfsIpAddress?: string;
|
||||
/** Specifies information about the operating system disk used by baremetal instance. */
|
||||
osDisks?: Disk[];
|
||||
}
|
||||
|
||||
/** Specifies the disk information fo the AzureBareMetal instance */
|
||||
export interface Disk {
|
||||
/** The disk name. */
|
||||
name?: string;
|
||||
/** Specifies the size of an empty data disk in gigabytes. */
|
||||
diskSizeGB?: number;
|
||||
/**
|
||||
* Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly lun?: number;
|
||||
}
|
||||
|
||||
/** Specifies the operating system settings for the AzureBareMetal instance. */
|
||||
export interface OSProfile {
|
||||
/** Specifies the host OS name of the AzureBareMetal instance. */
|
||||
computerName?: string;
|
||||
/**
|
||||
* This property allows you to specify the type of the OS.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly osType?: string;
|
||||
/**
|
||||
* Specifies version of operating system.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly version?: string;
|
||||
/** Specifies the SSH public key used to access the operating system. */
|
||||
sshPublicKey?: string;
|
||||
}
|
||||
|
||||
/** Specifies the network settings for the AzureBareMetal instance disks. */
|
||||
export interface NetworkProfile {
|
||||
/** Specifies the network interfaces for the AzureBareMetal instance. */
|
||||
networkInterfaces?: IpAddress[];
|
||||
/**
|
||||
* Specifies the circuit id for connecting to express route.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly circuitId?: string;
|
||||
}
|
||||
|
||||
/** Specifies the IP address of the network interface. */
|
||||
export interface IpAddress {
|
||||
/** Specifies the IP address of the network interface. */
|
||||
ipAddress?: string;
|
||||
}
|
||||
|
||||
/** Metadata pertaining to creation and last modification of the resource. */
|
||||
export interface SystemData {
|
||||
/** The identity that created the resource. */
|
||||
createdBy?: string;
|
||||
/** The type of identity that created the resource. */
|
||||
createdByType?: CreatedByType;
|
||||
/** The timestamp of resource creation (UTC). */
|
||||
createdAt?: Date;
|
||||
/** The identity that last modified the resource. */
|
||||
lastModifiedBy?: string;
|
||||
/** The type of identity that last modified the resource. */
|
||||
lastModifiedByType?: CreatedByType;
|
||||
/** The timestamp of resource last modification (UTC) */
|
||||
lastModifiedAt?: Date;
|
||||
}
|
||||
|
||||
/** Common fields that are returned in the response for all Azure Resource Manager resources */
|
||||
export interface Resource {
|
||||
/**
|
||||
* Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly id?: string;
|
||||
/**
|
||||
* The name of the resource
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/**
|
||||
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
/** Error response. */
|
||||
export interface ErrorResponse {
|
||||
/** The error details. */
|
||||
error?: ErrorDefinition;
|
||||
}
|
||||
|
||||
/** Error definition. */
|
||||
export interface ErrorDefinition {
|
||||
/**
|
||||
* Service specific error code which serves as the substatus for the HTTP error code.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly code?: string;
|
||||
/**
|
||||
* Description of the error.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly message?: string;
|
||||
/**
|
||||
* Internal error details.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly details?: ErrorDefinition[];
|
||||
}
|
||||
|
||||
/** List of AzureBareMetal operations */
|
||||
export interface OperationList {
|
||||
/** List of AzureBareMetal operations */
|
||||
value?: Operation[];
|
||||
}
|
||||
|
||||
/** AzureBareMetal operation information */
|
||||
export interface Operation {
|
||||
/**
|
||||
* The name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/** Displayed AzureBareMetal operation information */
|
||||
display?: Display;
|
||||
/**
|
||||
* indicates whether an operation is a data action or not.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly isDataAction?: boolean;
|
||||
}
|
||||
|
||||
/** Detailed BareMetal operation information */
|
||||
export interface Display {
|
||||
/**
|
||||
* The localized friendly form of the resource provider name.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provider?: string;
|
||||
/**
|
||||
* The localized friendly form of the resource type related to this action/operation.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly resource?: string;
|
||||
/**
|
||||
* The localized friendly name for the operation as shown to the user.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly operation?: string;
|
||||
/**
|
||||
* The localized friendly description for the operation as shown to the user.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly description?: string;
|
||||
}
|
||||
|
||||
/** Tags field of the AzureBareMetal instance. */
|
||||
export interface Tags {
|
||||
/** Tags field of the AzureBareMetal instance. */
|
||||
tags?: { [propertyName: string]: string };
|
||||
}
|
||||
|
||||
/** Sample result definition */
|
||||
export interface Result {
|
||||
/** Sample property of type string */
|
||||
sampleProperty?: string;
|
||||
}
|
||||
|
||||
/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */
|
||||
export interface TrackedResource extends Resource {
|
||||
/** Resource tags. */
|
||||
tags?: { [propertyName: string]: string };
|
||||
/** The geo-location where the resource lives */
|
||||
location: string;
|
||||
}
|
||||
|
||||
/** AzureBareMetal instance info on Azure (ARM properties and AzureBareMetal properties) */
|
||||
export interface AzureBareMetalInstance extends TrackedResource {
|
||||
/**
|
||||
* The system metadata relating to this resource.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
/** Specifies the hardware settings for the AzureBareMetal instance. */
|
||||
hardwareProfile?: HardwareProfile;
|
||||
/** Specifies the storage settings for the AzureBareMetal instance disks. */
|
||||
storageProfile?: StorageProfile;
|
||||
/** Specifies the operating system settings for the AzureBareMetal instance. */
|
||||
osProfile?: OSProfile;
|
||||
/** Specifies the network settings for the AzureBareMetal instance. */
|
||||
networkProfile?: NetworkProfile;
|
||||
/**
|
||||
* Specifies the AzureBareMetal instance unique ID.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly azureBareMetalInstanceId?: string;
|
||||
/**
|
||||
* Resource power state
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly powerState?: AzureBareMetalInstancePowerStateEnum;
|
||||
/**
|
||||
* Resource proximity placement group
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly proximityPlacementGroup?: string;
|
||||
/**
|
||||
* Hardware revision of an AzureBareMetal instance
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly hwRevision?: string;
|
||||
/** ARM ID of another AzureBareMetalInstance that will share a network with this AzureBareMetalInstance */
|
||||
partnerNodeId?: string;
|
||||
/**
|
||||
* State of provisioning of the AzureBareMetalInstance
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provisioningState?: AzureBareMetalProvisioningStatesEnum;
|
||||
}
|
||||
|
||||
/** Known values of {@link AzureBareMetalHardwareTypeNamesEnum} that the service accepts. */
|
||||
export enum KnownAzureBareMetalHardwareTypeNamesEnum {
|
||||
/** CiscoUCS */
|
||||
CiscoUCS = "Cisco_UCS",
|
||||
/** HPE */
|
||||
HPE = "HPE"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for AzureBareMetalHardwareTypeNamesEnum. \
|
||||
* {@link KnownAzureBareMetalHardwareTypeNamesEnum} can be used interchangeably with AzureBareMetalHardwareTypeNamesEnum,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **Cisco_UCS** \
|
||||
* **HPE**
|
||||
*/
|
||||
export type AzureBareMetalHardwareTypeNamesEnum = string;
|
||||
|
||||
/** Known values of {@link AzureBareMetalInstanceSizeNamesEnum} that the service accepts. */
|
||||
export enum KnownAzureBareMetalInstanceSizeNamesEnum {
|
||||
/** S72M */
|
||||
S72M = "S72m",
|
||||
/** S144M */
|
||||
S144M = "S144m",
|
||||
/** S72 */
|
||||
S72 = "S72",
|
||||
/** S144 */
|
||||
S144 = "S144",
|
||||
/** S192 */
|
||||
S192 = "S192",
|
||||
/** S192M */
|
||||
S192M = "S192m",
|
||||
/** S192Xm */
|
||||
S192Xm = "S192xm",
|
||||
/** S96 */
|
||||
S96 = "S96",
|
||||
/** S112 */
|
||||
S112 = "S112",
|
||||
/** S224 */
|
||||
S224 = "S224",
|
||||
/** S224M */
|
||||
S224M = "S224m",
|
||||
/** S224Om */
|
||||
S224Om = "S224om",
|
||||
/** S224Oo */
|
||||
S224Oo = "S224oo",
|
||||
/** S224Oom */
|
||||
S224Oom = "S224oom",
|
||||
/** S224Ooo */
|
||||
S224Ooo = "S224ooo",
|
||||
/** S384 */
|
||||
S384 = "S384",
|
||||
/** S384M */
|
||||
S384M = "S384m",
|
||||
/** S384Xm */
|
||||
S384Xm = "S384xm",
|
||||
/** S384Xxm */
|
||||
S384Xxm = "S384xxm",
|
||||
/** S448 */
|
||||
S448 = "S448",
|
||||
/** S448M */
|
||||
S448M = "S448m",
|
||||
/** S448Om */
|
||||
S448Om = "S448om",
|
||||
/** S448Oo */
|
||||
S448Oo = "S448oo",
|
||||
/** S448Oom */
|
||||
S448Oom = "S448oom",
|
||||
/** S448Ooo */
|
||||
S448Ooo = "S448ooo",
|
||||
/** S576M */
|
||||
S576M = "S576m",
|
||||
/** S576Xm */
|
||||
S576Xm = "S576xm",
|
||||
/** S672 */
|
||||
S672 = "S672",
|
||||
/** S672M */
|
||||
S672M = "S672m",
|
||||
/** S672Om */
|
||||
S672Om = "S672om",
|
||||
/** S672Oo */
|
||||
S672Oo = "S672oo",
|
||||
/** S672Oom */
|
||||
S672Oom = "S672oom",
|
||||
/** S672Ooo */
|
||||
S672Ooo = "S672ooo",
|
||||
/** S768 */
|
||||
S768 = "S768",
|
||||
/** S768M */
|
||||
S768M = "S768m",
|
||||
/** S768Xm */
|
||||
S768Xm = "S768xm",
|
||||
/** S896 */
|
||||
S896 = "S896",
|
||||
/** S896M */
|
||||
S896M = "S896m",
|
||||
/** S896Om */
|
||||
S896Om = "S896om",
|
||||
/** S896Oo */
|
||||
S896Oo = "S896oo",
|
||||
/** S896Oom */
|
||||
S896Oom = "S896oom",
|
||||
/** S896Ooo */
|
||||
S896Ooo = "S896ooo",
|
||||
/** S960M */
|
||||
S960M = "S960m"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for AzureBareMetalInstanceSizeNamesEnum. \
|
||||
* {@link KnownAzureBareMetalInstanceSizeNamesEnum} can be used interchangeably with AzureBareMetalInstanceSizeNamesEnum,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **S72m** \
|
||||
* **S144m** \
|
||||
* **S72** \
|
||||
* **S144** \
|
||||
* **S192** \
|
||||
* **S192m** \
|
||||
* **S192xm** \
|
||||
* **S96** \
|
||||
* **S112** \
|
||||
* **S224** \
|
||||
* **S224m** \
|
||||
* **S224om** \
|
||||
* **S224oo** \
|
||||
* **S224oom** \
|
||||
* **S224ooo** \
|
||||
* **S384** \
|
||||
* **S384m** \
|
||||
* **S384xm** \
|
||||
* **S384xxm** \
|
||||
* **S448** \
|
||||
* **S448m** \
|
||||
* **S448om** \
|
||||
* **S448oo** \
|
||||
* **S448oom** \
|
||||
* **S448ooo** \
|
||||
* **S576m** \
|
||||
* **S576xm** \
|
||||
* **S672** \
|
||||
* **S672m** \
|
||||
* **S672om** \
|
||||
* **S672oo** \
|
||||
* **S672oom** \
|
||||
* **S672ooo** \
|
||||
* **S768** \
|
||||
* **S768m** \
|
||||
* **S768xm** \
|
||||
* **S896** \
|
||||
* **S896m** \
|
||||
* **S896om** \
|
||||
* **S896oo** \
|
||||
* **S896oom** \
|
||||
* **S896ooo** \
|
||||
* **S960m**
|
||||
*/
|
||||
export type AzureBareMetalInstanceSizeNamesEnum = string;
|
||||
|
||||
/** Known values of {@link AzureBareMetalInstancePowerStateEnum} that the service accepts. */
|
||||
export enum KnownAzureBareMetalInstancePowerStateEnum {
|
||||
/** Starting */
|
||||
Starting = "starting",
|
||||
/** Started */
|
||||
Started = "started",
|
||||
/** Stopping */
|
||||
Stopping = "stopping",
|
||||
/** Stopped */
|
||||
Stopped = "stopped",
|
||||
/** Restarting */
|
||||
Restarting = "restarting",
|
||||
/** Unknown */
|
||||
Unknown = "unknown"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for AzureBareMetalInstancePowerStateEnum. \
|
||||
* {@link KnownAzureBareMetalInstancePowerStateEnum} can be used interchangeably with AzureBareMetalInstancePowerStateEnum,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **starting** \
|
||||
* **started** \
|
||||
* **stopping** \
|
||||
* **stopped** \
|
||||
* **restarting** \
|
||||
* **unknown**
|
||||
*/
|
||||
export type AzureBareMetalInstancePowerStateEnum = string;
|
||||
|
||||
/** Known values of {@link AzureBareMetalProvisioningStatesEnum} that the service accepts. */
|
||||
export enum KnownAzureBareMetalProvisioningStatesEnum {
|
||||
/** Accepted */
|
||||
Accepted = "Accepted",
|
||||
/** Creating */
|
||||
Creating = "Creating",
|
||||
/** Updating */
|
||||
Updating = "Updating",
|
||||
/** Failed */
|
||||
Failed = "Failed",
|
||||
/** Succeeded */
|
||||
Succeeded = "Succeeded",
|
||||
/** Deleting */
|
||||
Deleting = "Deleting",
|
||||
/** Migrating */
|
||||
Migrating = "Migrating"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for AzureBareMetalProvisioningStatesEnum. \
|
||||
* {@link KnownAzureBareMetalProvisioningStatesEnum} can be used interchangeably with AzureBareMetalProvisioningStatesEnum,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **Accepted** \
|
||||
* **Creating** \
|
||||
* **Updating** \
|
||||
* **Failed** \
|
||||
* **Succeeded** \
|
||||
* **Deleting** \
|
||||
* **Migrating**
|
||||
*/
|
||||
export type AzureBareMetalProvisioningStatesEnum = string;
|
||||
|
||||
/** Known values of {@link CreatedByType} that the service accepts. */
|
||||
export enum KnownCreatedByType {
|
||||
/** User */
|
||||
User = "User",
|
||||
/** Application */
|
||||
Application = "Application",
|
||||
/** ManagedIdentity */
|
||||
ManagedIdentity = "ManagedIdentity",
|
||||
/** Key */
|
||||
Key = "Key"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for CreatedByType. \
|
||||
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **User** \
|
||||
* **Application** \
|
||||
* **ManagedIdentity** \
|
||||
* **Key**
|
||||
*/
|
||||
export type CreatedByType = string;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface AzureBareMetalInstancesListBySubscriptionOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listBySubscription operation. */
|
||||
export type AzureBareMetalInstancesListBySubscriptionResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface AzureBareMetalInstancesListByResourceGroupOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByResourceGroup operation. */
|
||||
export type AzureBareMetalInstancesListByResourceGroupResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface AzureBareMetalInstancesGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type AzureBareMetalInstancesGetResponse = AzureBareMetalInstance;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface AzureBareMetalInstancesUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the update operation. */
|
||||
export type AzureBareMetalInstancesUpdateResponse = AzureBareMetalInstance;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface AzureBareMetalInstancesListBySubscriptionNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listBySubscriptionNext operation. */
|
||||
export type AzureBareMetalInstancesListBySubscriptionNextResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface AzureBareMetalInstancesListByResourceGroupNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByResourceGroupNext operation. */
|
||||
export type AzureBareMetalInstancesListByResourceGroupNextResponse = AzureBareMetalInstancesListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface OperationsListOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the list operation. */
|
||||
export type OperationsListResponse = OperationList;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface BareMetalInfrastructureClientOptionalParams
|
||||
extends coreClient.ServiceClientOptions {
|
||||
/** server parameter */
|
||||
$host?: string;
|
||||
/** Api Version */
|
||||
apiVersion?: string;
|
||||
/** Overrides client endpoint. */
|
||||
endpoint?: string;
|
||||
}
|
|
@ -0,0 +1,549 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 * as coreClient from "@azure/core-client";
|
||||
|
||||
export const AzureBareMetalInstancesListResult: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "AzureBareMetalInstancesListResult",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "AzureBareMetalInstance"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const HardwareProfile: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "HardwareProfile",
|
||||
modelProperties: {
|
||||
hardwareType: {
|
||||
serializedName: "hardwareType",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
azureBareMetalInstanceSize: {
|
||||
serializedName: "azureBareMetalInstanceSize",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const StorageProfile: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "StorageProfile",
|
||||
modelProperties: {
|
||||
nfsIpAddress: {
|
||||
serializedName: "nfsIpAddress",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
osDisks: {
|
||||
serializedName: "osDisks",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Disk"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Disk: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Disk",
|
||||
modelProperties: {
|
||||
name: {
|
||||
serializedName: "name",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
diskSizeGB: {
|
||||
serializedName: "diskSizeGB",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
},
|
||||
lun: {
|
||||
serializedName: "lun",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const OSProfile: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OSProfile",
|
||||
modelProperties: {
|
||||
computerName: {
|
||||
serializedName: "computerName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
osType: {
|
||||
serializedName: "osType",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
version: {
|
||||
serializedName: "version",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
sshPublicKey: {
|
||||
serializedName: "sshPublicKey",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const NetworkProfile: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NetworkProfile",
|
||||
modelProperties: {
|
||||
networkInterfaces: {
|
||||
serializedName: "networkInterfaces",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "IpAddress"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
circuitId: {
|
||||
serializedName: "circuitId",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const IpAddress: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "IpAddress",
|
||||
modelProperties: {
|
||||
ipAddress: {
|
||||
serializedName: "ipAddress",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const SystemData: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "SystemData",
|
||||
modelProperties: {
|
||||
createdBy: {
|
||||
serializedName: "createdBy",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
createdByType: {
|
||||
serializedName: "createdByType",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
createdAt: {
|
||||
serializedName: "createdAt",
|
||||
type: {
|
||||
name: "DateTime"
|
||||
}
|
||||
},
|
||||
lastModifiedBy: {
|
||||
serializedName: "lastModifiedBy",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
lastModifiedByType: {
|
||||
serializedName: "lastModifiedByType",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
lastModifiedAt: {
|
||||
serializedName: "lastModifiedAt",
|
||||
type: {
|
||||
name: "DateTime"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Resource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Resource",
|
||||
modelProperties: {
|
||||
id: {
|
||||
serializedName: "id",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
name: {
|
||||
serializedName: "name",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
type: {
|
||||
serializedName: "type",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ErrorResponse: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ErrorResponse",
|
||||
modelProperties: {
|
||||
error: {
|
||||
serializedName: "error",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ErrorDefinition"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ErrorDefinition: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ErrorDefinition",
|
||||
modelProperties: {
|
||||
code: {
|
||||
serializedName: "code",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
message: {
|
||||
serializedName: "message",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
details: {
|
||||
serializedName: "details",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ErrorDefinition"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const OperationList: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationList",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Operation"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Operation: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Operation",
|
||||
modelProperties: {
|
||||
name: {
|
||||
serializedName: "name",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
display: {
|
||||
serializedName: "display",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Display"
|
||||
}
|
||||
},
|
||||
isDataAction: {
|
||||
serializedName: "isDataAction",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "Boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Display: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Display",
|
||||
modelProperties: {
|
||||
provider: {
|
||||
serializedName: "provider",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
resource: {
|
||||
serializedName: "resource",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
operation: {
|
||||
serializedName: "operation",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
description: {
|
||||
serializedName: "description",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Tags: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Tags",
|
||||
modelProperties: {
|
||||
tags: {
|
||||
serializedName: "tags",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Result: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Result",
|
||||
modelProperties: {
|
||||
sampleProperty: {
|
||||
serializedName: "sampleProperty",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const TrackedResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "TrackedResource",
|
||||
modelProperties: {
|
||||
...Resource.type.modelProperties,
|
||||
tags: {
|
||||
serializedName: "tags",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
},
|
||||
location: {
|
||||
serializedName: "location",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const AzureBareMetalInstance: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "AzureBareMetalInstance",
|
||||
modelProperties: {
|
||||
...TrackedResource.type.modelProperties,
|
||||
systemData: {
|
||||
serializedName: "systemData",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "SystemData"
|
||||
}
|
||||
},
|
||||
hardwareProfile: {
|
||||
serializedName: "properties.hardwareProfile",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "HardwareProfile"
|
||||
}
|
||||
},
|
||||
storageProfile: {
|
||||
serializedName: "properties.storageProfile",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "StorageProfile"
|
||||
}
|
||||
},
|
||||
osProfile: {
|
||||
serializedName: "properties.osProfile",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OSProfile"
|
||||
}
|
||||
},
|
||||
networkProfile: {
|
||||
serializedName: "properties.networkProfile",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "NetworkProfile"
|
||||
}
|
||||
},
|
||||
azureBareMetalInstanceId: {
|
||||
serializedName: "properties.azureBareMetalInstanceId",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
powerState: {
|
||||
serializedName: "properties.powerState",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
proximityPlacementGroup: {
|
||||
serializedName: "properties.proximityPlacementGroup",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
hwRevision: {
|
||||
serializedName: "properties.hwRevision",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
partnerNodeId: {
|
||||
serializedName: "properties.partnerNodeId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
provisioningState: {
|
||||
serializedName: "properties.provisioningState",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 {
|
||||
OperationParameter,
|
||||
OperationURLParameter,
|
||||
OperationQueryParameter
|
||||
} from "@azure/core-client";
|
||||
import { Tags as TagsMapper } from "../models/mappers";
|
||||
|
||||
export const accept: OperationParameter = {
|
||||
parameterPath: "accept",
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Accept",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const $host: OperationURLParameter = {
|
||||
parameterPath: "$host",
|
||||
mapper: {
|
||||
serializedName: "$host",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const apiVersion: OperationQueryParameter = {
|
||||
parameterPath: "apiVersion",
|
||||
mapper: {
|
||||
defaultValue: "2021-08-09",
|
||||
isConstant: true,
|
||||
serializedName: "api-version",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const subscriptionId: OperationURLParameter = {
|
||||
parameterPath: "subscriptionId",
|
||||
mapper: {
|
||||
constraints: {
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "subscriptionId",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const resourceGroupName: OperationURLParameter = {
|
||||
parameterPath: "resourceGroupName",
|
||||
mapper: {
|
||||
constraints: {
|
||||
MaxLength: 90,
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "resourceGroupName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const azureBareMetalInstanceName: OperationURLParameter = {
|
||||
parameterPath: "azureBareMetalInstanceName",
|
||||
mapper: {
|
||||
serializedName: "azureBareMetalInstanceName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const contentType: OperationParameter = {
|
||||
parameterPath: ["options", "contentType"],
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Content-Type",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const tagsParameter: OperationParameter = {
|
||||
parameterPath: "tagsParameter",
|
||||
mapper: TagsMapper
|
||||
};
|
||||
|
||||
export const nextLink: OperationURLParameter = {
|
||||
parameterPath: "nextLink",
|
||||
mapper: {
|
||||
serializedName: "nextLink",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
|
@ -0,0 +1,395 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
||||
import { setContinuationToken } from "../pagingHelper";
|
||||
import { AzureBareMetalInstances } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { BareMetalInfrastructureClient } from "../bareMetalInfrastructureClient";
|
||||
import {
|
||||
AzureBareMetalInstance,
|
||||
AzureBareMetalInstancesListBySubscriptionNextOptionalParams,
|
||||
AzureBareMetalInstancesListBySubscriptionOptionalParams,
|
||||
AzureBareMetalInstancesListBySubscriptionResponse,
|
||||
AzureBareMetalInstancesListByResourceGroupNextOptionalParams,
|
||||
AzureBareMetalInstancesListByResourceGroupOptionalParams,
|
||||
AzureBareMetalInstancesListByResourceGroupResponse,
|
||||
AzureBareMetalInstancesGetOptionalParams,
|
||||
AzureBareMetalInstancesGetResponse,
|
||||
Tags,
|
||||
AzureBareMetalInstancesUpdateOptionalParams,
|
||||
AzureBareMetalInstancesUpdateResponse,
|
||||
AzureBareMetalInstancesListBySubscriptionNextResponse,
|
||||
AzureBareMetalInstancesListByResourceGroupNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing AzureBareMetalInstances operations. */
|
||||
export class AzureBareMetalInstancesImpl implements AzureBareMetalInstances {
|
||||
private readonly client: BareMetalInfrastructureClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class AzureBareMetalInstances class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: BareMetalInfrastructureClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of AzureBareMetal instances in the specified subscription. The operations returns
|
||||
* various properties of each Azure BareMetal instance.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listBySubscription(
|
||||
options?: AzureBareMetalInstancesListBySubscriptionOptionalParams
|
||||
): PagedAsyncIterableIterator<AzureBareMetalInstance> {
|
||||
const iter = this.listBySubscriptionPagingAll(options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: (settings?: PageSettings) => {
|
||||
if (settings?.maxPageSize) {
|
||||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listBySubscriptionPagingPage(options, settings);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listBySubscriptionPagingPage(
|
||||
options?: AzureBareMetalInstancesListBySubscriptionOptionalParams,
|
||||
settings?: PageSettings
|
||||
): AsyncIterableIterator<AzureBareMetalInstance[]> {
|
||||
let result: AzureBareMetalInstancesListBySubscriptionResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
if (!continuationToken) {
|
||||
result = await this._listBySubscription(options);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
while (continuationToken) {
|
||||
result = await this._listBySubscriptionNext(continuationToken, options);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
}
|
||||
|
||||
private async *listBySubscriptionPagingAll(
|
||||
options?: AzureBareMetalInstancesListBySubscriptionOptionalParams
|
||||
): AsyncIterableIterator<AzureBareMetalInstance> {
|
||||
for await (const page of this.listBySubscriptionPagingPage(options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of AzureBareMetal instances in the specified subscription and resource group. The
|
||||
* operations returns various properties of each Azure BareMetal instance.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listByResourceGroup(
|
||||
resourceGroupName: string,
|
||||
options?: AzureBareMetalInstancesListByResourceGroupOptionalParams
|
||||
): PagedAsyncIterableIterator<AzureBareMetalInstance> {
|
||||
const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: (settings?: PageSettings) => {
|
||||
if (settings?.maxPageSize) {
|
||||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listByResourceGroupPagingPage(
|
||||
resourceGroupName,
|
||||
options,
|
||||
settings
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listByResourceGroupPagingPage(
|
||||
resourceGroupName: string,
|
||||
options?: AzureBareMetalInstancesListByResourceGroupOptionalParams,
|
||||
settings?: PageSettings
|
||||
): AsyncIterableIterator<AzureBareMetalInstance[]> {
|
||||
let result: AzureBareMetalInstancesListByResourceGroupResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
if (!continuationToken) {
|
||||
result = await this._listByResourceGroup(resourceGroupName, options);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
while (continuationToken) {
|
||||
result = await this._listByResourceGroupNext(
|
||||
resourceGroupName,
|
||||
continuationToken,
|
||||
options
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
}
|
||||
|
||||
private async *listByResourceGroupPagingAll(
|
||||
resourceGroupName: string,
|
||||
options?: AzureBareMetalInstancesListByResourceGroupOptionalParams
|
||||
): AsyncIterableIterator<AzureBareMetalInstance> {
|
||||
for await (const page of this.listByResourceGroupPagingPage(
|
||||
resourceGroupName,
|
||||
options
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of AzureBareMetal instances in the specified subscription. The operations returns
|
||||
* various properties of each Azure BareMetal instance.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listBySubscription(
|
||||
options?: AzureBareMetalInstancesListBySubscriptionOptionalParams
|
||||
): Promise<AzureBareMetalInstancesListBySubscriptionResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ options },
|
||||
listBySubscriptionOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of AzureBareMetal instances in the specified subscription and resource group. The
|
||||
* operations returns various properties of each Azure BareMetal instance.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByResourceGroup(
|
||||
resourceGroupName: string,
|
||||
options?: AzureBareMetalInstancesListByResourceGroupOptionalParams
|
||||
): Promise<AzureBareMetalInstancesListByResourceGroupResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, options },
|
||||
listByResourceGroupOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
azureBareMetalInstanceName: string,
|
||||
options?: AzureBareMetalInstancesGetOptionalParams
|
||||
): Promise<AzureBareMetalInstancesGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, azureBareMetalInstanceName, options },
|
||||
getOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group,
|
||||
* and instance name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance.
|
||||
* @param tagsParameter Request body that only contains the new Tags field
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
update(
|
||||
resourceGroupName: string,
|
||||
azureBareMetalInstanceName: string,
|
||||
tagsParameter: Tags,
|
||||
options?: AzureBareMetalInstancesUpdateOptionalParams
|
||||
): Promise<AzureBareMetalInstancesUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, azureBareMetalInstanceName, tagsParameter, options },
|
||||
updateOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListBySubscriptionNext
|
||||
* @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listBySubscriptionNext(
|
||||
nextLink: string,
|
||||
options?: AzureBareMetalInstancesListBySubscriptionNextOptionalParams
|
||||
): Promise<AzureBareMetalInstancesListBySubscriptionNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ nextLink, options },
|
||||
listBySubscriptionNextOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListByResourceGroupNext
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByResourceGroupNext(
|
||||
resourceGroupName: string,
|
||||
nextLink: string,
|
||||
options?: AzureBareMetalInstancesListByResourceGroupNextOptionalParams
|
||||
): Promise<AzureBareMetalInstancesListByResourceGroupNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, nextLink, options },
|
||||
listByResourceGroupNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.AzureBareMetalInstancesListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.AzureBareMetalInstancesListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.AzureBareMetalInstance
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.azureBareMetalInstanceName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const updateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BareMetalInfrastructure/bareMetalInstances/{azureBareMetalInstanceName}",
|
||||
httpMethod: "PATCH",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.AzureBareMetalInstance
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.tagsParameter,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.azureBareMetalInstanceName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.AzureBareMetalInstancesListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.nextLink
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.AzureBareMetalInstancesListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.nextLink
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
export * from "./azureBareMetalInstances";
|
||||
export * from "./operations";
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
||||
import { Operations } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { BareMetalInfrastructureClient } from "../bareMetalInfrastructureClient";
|
||||
import {
|
||||
Operation,
|
||||
OperationsListOptionalParams,
|
||||
OperationsListResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing Operations operations. */
|
||||
export class OperationsImpl implements Operations {
|
||||
private readonly client: BareMetalInfrastructureClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Operations class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: BareMetalInfrastructureClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of AzureBareMetal management operations.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
options?: OperationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<Operation> {
|
||||
const iter = this.listPagingAll(options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: (settings?: PageSettings) => {
|
||||
if (settings?.maxPageSize) {
|
||||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listPagingPage(options, settings);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
options?: OperationsListOptionalParams,
|
||||
_settings?: PageSettings
|
||||
): AsyncIterableIterator<Operation[]> {
|
||||
let result: OperationsListResponse;
|
||||
result = await this._list(options);
|
||||
yield result.value || [];
|
||||
}
|
||||
|
||||
private async *listPagingAll(
|
||||
options?: OperationsListOptionalParams
|
||||
): AsyncIterableIterator<Operation> {
|
||||
for await (const page of this.listPagingPage(options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of AzureBareMetal management operations.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _list(
|
||||
options?: OperationsListOptionalParams
|
||||
): Promise<OperationsListResponse> {
|
||||
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/providers/Microsoft.BareMetalInfrastructure/operations",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.OperationList
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [Parameters.$host],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 { PagedAsyncIterableIterator } from "@azure/core-paging";
|
||||
import {
|
||||
AzureBareMetalInstance,
|
||||
AzureBareMetalInstancesListBySubscriptionOptionalParams,
|
||||
AzureBareMetalInstancesListByResourceGroupOptionalParams,
|
||||
AzureBareMetalInstancesGetOptionalParams,
|
||||
AzureBareMetalInstancesGetResponse,
|
||||
Tags,
|
||||
AzureBareMetalInstancesUpdateOptionalParams,
|
||||
AzureBareMetalInstancesUpdateResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a AzureBareMetalInstances. */
|
||||
export interface AzureBareMetalInstances {
|
||||
/**
|
||||
* Gets a list of AzureBareMetal instances in the specified subscription. The operations returns
|
||||
* various properties of each Azure BareMetal instance.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listBySubscription(
|
||||
options?: AzureBareMetalInstancesListBySubscriptionOptionalParams
|
||||
): PagedAsyncIterableIterator<AzureBareMetalInstance>;
|
||||
/**
|
||||
* Gets a list of AzureBareMetal instances in the specified subscription and resource group. The
|
||||
* operations returns various properties of each Azure BareMetal instance.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByResourceGroup(
|
||||
resourceGroupName: string,
|
||||
options?: AzureBareMetalInstancesListByResourceGroupOptionalParams
|
||||
): PagedAsyncIterableIterator<AzureBareMetalInstance>;
|
||||
/**
|
||||
* Gets an Azure BareMetal instance for the specified subscription, resource group, and instance name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
azureBareMetalInstanceName: string,
|
||||
options?: AzureBareMetalInstancesGetOptionalParams
|
||||
): Promise<AzureBareMetalInstancesGetResponse>;
|
||||
/**
|
||||
* Patches the Tags field of a Azure BareMetal instance for the specified subscription, resource group,
|
||||
* and instance name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param azureBareMetalInstanceName Name of the Azure BareMetal on Azure instance.
|
||||
* @param tagsParameter Request body that only contains the new Tags field
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
update(
|
||||
resourceGroupName: string,
|
||||
azureBareMetalInstanceName: string,
|
||||
tagsParameter: Tags,
|
||||
options?: AzureBareMetalInstancesUpdateOptionalParams
|
||||
): Promise<AzureBareMetalInstancesUpdateResponse>;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
export * from "./azureBareMetalInstances";
|
||||
export * from "./operations";
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 { PagedAsyncIterableIterator } from "@azure/core-paging";
|
||||
import { Operation, OperationsListOptionalParams } from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a Operations. */
|
||||
export interface Operations {
|
||||
/**
|
||||
* Gets a list of AzureBareMetal management operations.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
list(
|
||||
options?: OperationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<Operation>;
|
||||
}
|
|
@ -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.
|
||||
*/
|
||||
|
||||
export interface PageInfo {
|
||||
continuationToken?: string;
|
||||
}
|
||||
|
||||
const pageMap = new WeakMap<object, PageInfo>();
|
||||
|
||||
/**
|
||||
* Given the last `.value` produced by the `byPage` iterator,
|
||||
* returns a continuation token that can be used to begin paging from
|
||||
* that point later.
|
||||
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
||||
* @returns The continuation token that can be passed into byPage() during future calls.
|
||||
*/
|
||||
export function getContinuationToken(page: unknown): string | undefined {
|
||||
if (typeof page !== "object" || page === null) {
|
||||
return undefined;
|
||||
}
|
||||
return pageMap.get(page)?.continuationToken;
|
||||
}
|
||||
|
||||
export function setContinuationToken(
|
||||
page: unknown,
|
||||
continuationToken: string | undefined
|
||||
): void {
|
||||
if (typeof page !== "object" || page === null || !continuationToken) {
|
||||
return;
|
||||
}
|
||||
const pageInfo = pageMap.get(page) ?? {};
|
||||
pageInfo.continuationToken = continuationToken;
|
||||
pageMap.set(page, pageInfo);
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 {
|
||||
env,
|
||||
Recorder,
|
||||
RecorderStartOptions,
|
||||
delay,
|
||||
isPlaybackMode,
|
||||
} from "@azure-tools/test-recorder";
|
||||
import { createTestCredential } from "@azure-tools/test-credential";
|
||||
import { assert } from "chai";
|
||||
import { Context } from "mocha";
|
||||
import { BareMetalInfrastructureClient } from "../src/bareMetalInfrastructureClient";
|
||||
|
||||
const replaceableVariables: Record<string, string> = {
|
||||
AZURE_CLIENT_ID: "azure_client_id",
|
||||
AZURE_CLIENT_SECRET: "azure_client_secret",
|
||||
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
|
||||
SUBSCRIPTION_ID: "azure_subscription_id"
|
||||
};
|
||||
|
||||
const recorderOptions: RecorderStartOptions = {
|
||||
envSetupForPlayback: replaceableVariables
|
||||
};
|
||||
|
||||
export const testPollingOptions = {
|
||||
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
|
||||
};
|
||||
|
||||
describe("baremetalinfrastructure test", () => {
|
||||
let recorder: Recorder;
|
||||
let subscriptionId: string;
|
||||
let client: BareMetalInfrastructureClient;
|
||||
let location: string;
|
||||
let resourceGroup: string;
|
||||
let resourcename: string;
|
||||
|
||||
beforeEach(async function (this: Context) {
|
||||
recorder = new Recorder(this.currentTest);
|
||||
await recorder.start(recorderOptions);
|
||||
subscriptionId = env.SUBSCRIPTION_ID || '';
|
||||
// This is an example of how the environment variables are used
|
||||
const credential = createTestCredential();
|
||||
client = new BareMetalInfrastructureClient(credential, subscriptionId, recorder.configureClientOptions({}));
|
||||
location = "eastus";
|
||||
resourceGroup = "myjstest";
|
||||
resourcename = "resourcetest";
|
||||
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
await recorder.stop();
|
||||
});
|
||||
|
||||
it("operation list test", async function () {
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
assert.notEqual(resArray.length, 0);
|
||||
});
|
||||
})
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "es6",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"declaration": true,
|
||||
"outDir": "./dist-esm",
|
||||
"importHelpers": true,
|
||||
"paths": {
|
||||
"@azure/arm-baremetalinfrastructure": [
|
||||
"./src/index"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts",
|
||||
"./test/**/*.ts",
|
||||
"samples-dev/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- feature/*
|
||||
- release/*
|
||||
- hotfix/*
|
||||
exclude:
|
||||
- feature/v4
|
||||
paths:
|
||||
include:
|
||||
- sdk/baremetalinfrastructure/arm-baremetalinfrastructure
|
||||
- sdk/baremetalinfrastructure/ci.mgmt.yml
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- feature/*
|
||||
- release/*
|
||||
- hotfix/*
|
||||
exclude:
|
||||
- feature/v4
|
||||
paths:
|
||||
include:
|
||||
- sdk/baremetalinfrastructure/arm-baremetalinfrastructure
|
||||
- sdk/baremetalinfrastructure/ci.mgmt.yml
|
||||
|
||||
extends:
|
||||
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
|
||||
parameters:
|
||||
ServiceDirectory: baremetalinfrastructure
|
||||
Artifacts:
|
||||
- name: azure-arm-baremetalinfrastructure
|
||||
safeName: azurearmbaremetalinfrastructure
|
||||
|
Загрузка…
Ссылка в новой задаче