release resourceconnector package (#22380)

* release resourceconnector package

* add link in a file

* fix error

Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) <v-ziweichen@microsoft.com>
This commit is contained in:
kazrael2119 2022-06-30 13:21:11 +08:00 коммит произвёл GitHub
Родитель db3e4e25ba
Коммит 90d063b3ed
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
63 изменённых файлов: 5073 добавлений и 2 удалений

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

@ -144,6 +144,7 @@ specifiers:
'@rush-temp/arm-redisenterprisecache': file:./projects/arm-redisenterprisecache.tgz
'@rush-temp/arm-relay': file:./projects/arm-relay.tgz
'@rush-temp/arm-reservations': file:./projects/arm-reservations.tgz
'@rush-temp/arm-resourceconnector': file:./projects/arm-resourceconnector.tgz
'@rush-temp/arm-resourcegraph': file:./projects/arm-resourcegraph.tgz
'@rush-temp/arm-resourcehealth': file:./projects/arm-resourcehealth.tgz
'@rush-temp/arm-resourcemover': file:./projects/arm-resourcemover.tgz
@ -430,6 +431,7 @@ dependencies:
'@rush-temp/arm-redisenterprisecache': file:projects/arm-redisenterprisecache.tgz
'@rush-temp/arm-relay': file:projects/arm-relay.tgz
'@rush-temp/arm-reservations': file:projects/arm-reservations.tgz
'@rush-temp/arm-resourceconnector': file:projects/arm-resourceconnector.tgz
'@rush-temp/arm-resourcegraph': file:projects/arm-resourcegraph.tgz
'@rush-temp/arm-resourcehealth': file:projects/arm-resourcehealth.tgz
'@rush-temp/arm-resourcemover': file:projects/arm-resourcemover.tgz
@ -13553,6 +13555,35 @@ packages:
- supports-color
dev: false
file:projects/arm-resourceconnector.tgz:
resolution: {integrity: sha512-RBmUmOPz9iY8y2RlrC8jU6GqJCodqy1QGJ8IGXI5ZgQEalR6N7iMMAo5M519FNoGJMgqcWw7lF5ntmLqiBcsZQ==, tarball: file:projects/arm-resourceconnector.tgz}
name: '@rush-temp/arm-resourceconnector'
version: 0.0.0
dependencies:
'@azure/core-lro': 2.2.4
'@azure/identity': 2.0.4
'@microsoft/api-extractor': 7.18.11
'@rollup/plugin-commonjs': 21.1.0_rollup@2.74.1
'@rollup/plugin-json': 4.1.0_rollup@2.74.1
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.74.1
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.74.1
'@types/chai': 4.3.1
chai: 4.3.6
cross-env: 7.0.3
mkdirp: 1.0.4
mocha: 7.2.0
rimraf: 3.0.2
rollup: 2.74.1
rollup-plugin-sourcemaps: 0.6.3_rollup@2.74.1
tslib: 2.4.0
typescript: 4.2.4
uglify-js: 3.15.5
transitivePeerDependencies:
- '@types/node'
- debug
- supports-color
dev: false
file:projects/arm-resourcegraph.tgz:
resolution: {integrity: sha512-0ECZkn0Vu/MMysUtodUMIulb/vYcwG+kzLPlbh9CLw0LU6lbzjpTyk0nrx9jGMMzj+sYjS3qBzIirlyMoa0GIg==, tarball: file:projects/arm-resourcegraph.tgz}
name: '@rush-temp/arm-resourcegraph'

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

@ -6,3 +6,4 @@ https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob-cha
https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob-changefeed/samples/typescript
https://docs.microsoft.com/javascript/api/@azure/arm-app?view=azure-node-preview
https://docs.microsoft.com/en-us/rest/api/index
https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?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.
@ -1740,6 +1740,11 @@
"packageName": "@azure/arm-confidentialledger",
"projectFolder": "sdk/confidentialledger/arm-confidentialledger",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-resourceconnector",
"projectFolder": "sdk/resourceconnector/arm-resourceconnector",
"versionPolicyName": "management"
}
]
}
}

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

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

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

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

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

@ -0,0 +1,109 @@
# Azure ResourceConnectorManagement client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure ResourceConnectorManagement client.
The appliances Rest API spec.
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-resourceconnector) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started
### Currently supported environments
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
- Latest versions of Safari, Chrome, Edge and Firefox.
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
### Prerequisites
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-resourceconnector` package
Install the Azure ResourceConnectorManagement client library for JavaScript with `npm`:
```bash
npm install @azure/arm-resourceconnector
```
### Create and authenticate a `ResourceConnectorManagementClient`
To create a client object to access the Azure ResourceConnectorManagement API, you will need the `endpoint` of your Azure ResourceConnectorManagement resource and a `credential`. The Azure ResourceConnectorManagement client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure ResourceConnectorManagement 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 ResourceConnectorManagement** 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 { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
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 ResourceConnectorManagementClient(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 ResourceConnectorManagementClient(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
### ResourceConnectorManagementClient
`ResourceConnectorManagementClient` is the primary interface for developers using the Azure ResourceConnectorManagement client library. Explore the methods on this client object to understand the different features of the Azure ResourceConnectorManagement 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%2Fresourceconnector%2Farm-resourceconnector%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": "b8fc2b4ff626aab886f929e49926c6e836548e01",
"readme": "specification/resourceconnector/resource-manager/readme.md",
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resourceconnector\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.2",
"use": "@autorest/typescript@6.0.0-rc.1"
}

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

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

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

@ -0,0 +1,121 @@
{
"name": "@azure/arm-resourceconnector",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ResourceConnectorManagementClient.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=12.0.0"
},
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
"@azure/core-paging": "^1.2.0",
"@azure/core-client": "^1.5.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-rest-pipeline": "^1.8.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-resourceconnector.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "7.18.11",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-multi-entry": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"mkdirp": "^1.0.4",
"rollup": "^2.66.1",
"rollup-plugin-sourcemaps": "^0.6.3",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector",
"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/resourceConnectorManagementClient.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview"
}
}

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

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

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

@ -0,0 +1,400 @@
## API Report File for "@azure/arm-resourceconnector"
> 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';
import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';
// @public
export type AccessProfileType = string;
// @public
export interface Appliance extends TrackedResource {
distro?: Distro;
identity?: Identity;
infrastructureConfig?: AppliancePropertiesInfrastructureConfig;
readonly provisioningState?: string;
publicKey?: string;
readonly status?: Status;
readonly systemData?: SystemData;
version?: string;
}
// @public
export interface ApplianceCredentialKubeconfig {
readonly name?: AccessProfileType;
readonly value?: string;
}
// @public
export interface ApplianceListClusterCustomerUserCredentialResults {
readonly kubeconfigs?: ApplianceCredentialKubeconfig[];
readonly sshKeys?: {
[propertyName: string]: SSHKey;
};
}
// @public
export interface ApplianceListCredentialResults {
readonly hybridConnectionConfig?: HybridConnectionConfig;
readonly kubeconfigs?: ApplianceCredentialKubeconfig[];
}
// @public
export interface ApplianceListResult {
readonly nextLink?: string;
readonly value?: Appliance[];
}
// @public
export interface ApplianceOperation {
readonly description?: string;
readonly isDataAction?: boolean;
readonly name?: string;
readonly operation?: string;
readonly origin?: string;
readonly provider?: string;
readonly resource?: string;
}
// @public
export interface ApplianceOperationsList {
nextLink?: string;
value: ApplianceOperation[];
}
// @public
export interface AppliancePropertiesInfrastructureConfig {
provider?: Provider;
}
// @public
export interface Appliances {
beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: Appliance, options?: AppliancesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<AppliancesCreateOrUpdateResponse>, AppliancesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: Appliance, options?: AppliancesCreateOrUpdateOptionalParams): Promise<AppliancesCreateOrUpdateResponse>;
beginDelete(resourceGroupName: string, resourceName: string, options?: AppliancesDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: AppliancesDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, resourceName: string, options?: AppliancesGetOptionalParams): Promise<AppliancesGetResponse>;
getUpgradeGraph(resourceGroupName: string, resourceName: string, upgradeGraph: string, options?: AppliancesGetUpgradeGraphOptionalParams): Promise<AppliancesGetUpgradeGraphResponse>;
listByResourceGroup(resourceGroupName: string, options?: AppliancesListByResourceGroupOptionalParams): PagedAsyncIterableIterator<Appliance>;
listBySubscription(options?: AppliancesListBySubscriptionOptionalParams): PagedAsyncIterableIterator<Appliance>;
listClusterCustomerUserCredential(resourceGroupName: string, resourceName: string, options?: AppliancesListClusterCustomerUserCredentialOptionalParams): Promise<AppliancesListClusterCustomerUserCredentialResponse>;
listClusterUserCredential(resourceGroupName: string, resourceName: string, options?: AppliancesListClusterUserCredentialOptionalParams): Promise<AppliancesListClusterUserCredentialResponse>;
listOperations(options?: AppliancesListOperationsOptionalParams): PagedAsyncIterableIterator<ApplianceOperation>;
update(resourceGroupName: string, resourceName: string, options?: AppliancesUpdateOptionalParams): Promise<AppliancesUpdateResponse>;
}
// @public
export interface AppliancesCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export type AppliancesCreateOrUpdateResponse = Appliance;
// @public
export interface AppliancesDeleteOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
updateIntervalInMs?: number;
}
// @public
export interface AppliancesGetOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesGetResponse = Appliance;
// @public
export interface AppliancesGetUpgradeGraphOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesGetUpgradeGraphResponse = UpgradeGraph;
// @public
export interface AppliancesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListByResourceGroupNextResponse = ApplianceListResult;
// @public
export interface AppliancesListByResourceGroupOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListByResourceGroupResponse = ApplianceListResult;
// @public
export interface AppliancesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListBySubscriptionNextResponse = ApplianceListResult;
// @public
export interface AppliancesListBySubscriptionOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListBySubscriptionResponse = ApplianceListResult;
// @public
export interface AppliancesListClusterCustomerUserCredentialOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListClusterCustomerUserCredentialResponse = ApplianceListClusterCustomerUserCredentialResults;
// @public
export interface AppliancesListClusterUserCredentialOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListClusterUserCredentialResponse = ApplianceListCredentialResults;
// @public
export interface AppliancesListOperationsNextOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListOperationsNextResponse = ApplianceOperationsList;
// @public
export interface AppliancesListOperationsOptionalParams extends coreClient.OperationOptions {
}
// @public
export type AppliancesListOperationsResponse = ApplianceOperationsList;
// @public
export interface AppliancesUpdateOptionalParams extends coreClient.OperationOptions {
tags?: {
[propertyName: string]: string;
};
}
// @public
export type AppliancesUpdateResponse = Appliance;
// @public
export type CreatedByType = string;
// @public
export type Distro = string;
// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, unknown>;
readonly type?: string;
}
// @public
export interface ErrorDetail {
readonly additionalInfo?: ErrorAdditionalInfo[];
readonly code?: string;
readonly details?: ErrorDetail[];
readonly message?: string;
readonly target?: string;
}
// @public
export interface ErrorResponse {
error?: ErrorDetail;
}
// @public
export interface HybridConnectionConfig {
readonly expirationTime?: number;
readonly hybridConnectionName?: string;
readonly relay?: string;
readonly token?: string;
}
// @public
export interface Identity {
readonly principalId?: string;
readonly tenantId?: string;
type?: ResourceIdentityType;
}
// @public
export enum KnownAccessProfileType {
ClusterCustomerUser = "clusterCustomerUser",
ClusterUser = "clusterUser"
}
// @public
export enum KnownCreatedByType {
Application = "Application",
Key = "Key",
ManagedIdentity = "ManagedIdentity",
User = "User"
}
// @public
export enum KnownDistro {
AKSEdge = "AKSEdge"
}
// @public
export enum KnownProvider {
HCI = "HCI",
KubeVirt = "KubeVirt",
OpenStack = "OpenStack",
Scvmm = "SCVMM",
VMWare = "VMWare"
}
// @public
export enum KnownResourceIdentityType {
None = "None",
SystemAssigned = "SystemAssigned"
}
// @public
export enum KnownSSHKeyType {
SSHCustomerUser = "SSHCustomerUser"
}
// @public
export enum KnownStatus {
Connected = "Connected",
Connecting = "Connecting",
None = "None",
Offline = "Offline",
PostUpgrade = "PostUpgrade",
PreparingForUpgrade = "PreparingForUpgrade",
PreUpgrade = "PreUpgrade",
Running = "Running",
UpdatingCapi = "UpdatingCAPI",
UpdatingCloudOperator = "UpdatingCloudOperator",
UpdatingCluster = "UpdatingCluster",
UpgradeClusterExtensionFailedToDelete = "UpgradeClusterExtensionFailedToDelete",
UpgradeComplete = "UpgradeComplete",
UpgradeFailed = "UpgradeFailed",
UpgradePrerequisitesCompleted = "UpgradePrerequisitesCompleted",
Validating = "Validating",
WaitingForCloudOperator = "WaitingForCloudOperator",
WaitingForHeartbeat = "WaitingForHeartbeat"
}
// @public
export interface PatchableAppliance {
tags?: {
[propertyName: string]: string;
};
}
// @public
export type Provider = string;
// @public
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly type?: string;
}
// @public (undocumented)
export class ResourceConnectorManagementClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: ResourceConnectorManagementClientOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
appliances: Appliances;
// (undocumented)
subscriptionId: string;
}
// @public
export interface ResourceConnectorManagementClientOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}
// @public
export type ResourceIdentityType = string;
// @public
export interface SSHKey {
privateKey?: string;
publicKey?: string;
}
// @public
export type SSHKeyType = string;
// @public
export type Status = string;
// @public
export interface SupportedVersion {
readonly metadata?: SupportedVersionMetadata;
readonly version?: string;
}
// @public
export interface SupportedVersionCatalogVersion {
readonly data?: SupportedVersionCatalogVersionData;
readonly name?: string;
readonly namespace?: string;
}
// @public
export interface SupportedVersionCatalogVersionData {
readonly audience?: string;
readonly catalog?: string;
readonly offer?: string;
readonly version?: string;
}
// @public
export interface SupportedVersionMetadata {
readonly catalogVersion?: SupportedVersionCatalogVersion;
}
// @public
export interface SystemData {
createdAt?: Date;
createdBy?: string;
createdByType?: CreatedByType;
lastModifiedAt?: Date;
lastModifiedBy?: string;
lastModifiedByType?: CreatedByType;
}
// @public
export interface TrackedResource extends Resource {
location: string;
tags?: {
[propertyName: string]: string;
};
}
// @public
export interface UpgradeGraph {
readonly id?: string;
readonly name?: string;
properties?: UpgradeGraphProperties;
}
// @public
export interface UpgradeGraphProperties {
readonly applianceVersion?: string;
readonly supportedVersions?: SupportedVersion[];
}
// (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,45 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
Appliance,
ResourceConnectorManagementClient
} from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates or updates an Appliance in the specified Subscription and Resource Group.
*
* @summary Creates or updates an Appliance in the specified Subscription and Resource Group.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json
*/
async function createOrUpdateAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const parameters: Appliance = {
distro: "AKSEdge",
infrastructureConfig: { provider: "VMWare" },
location: "West US"
};
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
parameters
);
console.log(result);
}
createOrUpdateAppliance().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
*
* @summary Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesDelete.json
*/
async function deleteAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.beginDeleteAndWait(
resourceGroupName,
resourceName
);
console.log(result);
}
deleteAppliance().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the details of an Appliance with a specified resource group and name.
*
* @summary Gets the details of an Appliance with a specified resource group and name.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesGet.json
*/
async function getAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.get(resourceGroupName, resourceName);
console.log(result);
}
getAppliance().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
*
* @summary Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/UpgradeGraph.json
*/
async function getApplianceUpgradeGraph() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const upgradeGraph = "stable";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.getUpgradeGraph(
resourceGroupName,
resourceName,
upgradeGraph
);
console.log(result);
}
getApplianceUpgradeGraph().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance.
*
* @summary Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json
*/
async function listAppliancesByResourceGroup() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.appliances.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance
*
* @summary Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json
*/
async function listAppliancesBySubscription() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.appliances.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesBySubscription().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns the cluster customer user credentials for the dedicated appliance.
*
* @summary Returns the cluster customer user credentials for the dedicated appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json
*/
async function listClusterCustomerUserCredentialAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.listClusterCustomerUserCredential(
resourceGroupName,
resourceName
);
console.log(result);
}
listClusterCustomerUserCredentialAppliance().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns the cluster user credentials for the dedicated appliance.
*
* @summary Returns the cluster user credentials for the dedicated appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json
*/
async function listClusterUserCredentialAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.listClusterUserCredential(
resourceGroupName,
resourceName
);
console.log(result);
}
listClusterUserCredentialAppliance().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all available Appliances operations.
*
* @summary Lists all available Appliances operations.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListOperations.json
*/
async function listAppliancesOperations() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.appliances.listOperations()) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesOperations().catch(console.error);

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

@ -0,0 +1,42 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
AppliancesUpdateOptionalParams,
ResourceConnectorManagementClient
} from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
*
* @summary Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesPatch.json
*/
async function updateAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const tags = { key: "value" };
const options: AppliancesUpdateOptionalParams = { tags };
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.update(
resourceGroupName,
resourceName,
options
);
console.log(result);
}
updateAppliance().catch(console.error);

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

@ -0,0 +1,68 @@
# client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [appliancesCreateOrUpdateSample.js][appliancescreateorupdatesample] | Creates or updates an Appliance in the specified Subscription and Resource Group. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json |
| [appliancesDeleteSample.js][appliancesdeletesample] | Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesDelete.json |
| [appliancesGetSample.js][appliancesgetsample] | Gets the details of an Appliance with a specified resource group and name. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesGet.json |
| [appliancesGetUpgradeGraphSample.js][appliancesgetupgradegraphsample] | Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/UpgradeGraph.json |
| [appliancesListByResourceGroupSample.js][applianceslistbyresourcegroupsample] | Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json |
| [appliancesListBySubscriptionSample.js][applianceslistbysubscriptionsample] | Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json |
| [appliancesListClusterCustomerUserCredentialSample.js][applianceslistclustercustomerusercredentialsample] | Returns the cluster customer user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json |
| [appliancesListClusterUserCredentialSample.js][applianceslistclusterusercredentialsample] | Returns the cluster user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json |
| [appliancesListOperationsSample.js][applianceslistoperationssample] | Lists all available Appliances operations. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListOperations.json |
| [appliancesUpdateSample.js][appliancesupdatesample] | Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesPatch.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node appliancesCreateOrUpdateSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node appliancesCreateOrUpdateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[appliancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesCreateOrUpdateSample.js
[appliancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesDeleteSample.js
[appliancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetSample.js
[appliancesgetupgradegraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesGetUpgradeGraphSample.js
[applianceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListByResourceGroupSample.js
[applianceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListBySubscriptionSample.js
[applianceslistclustercustomerusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterCustomerUserCredentialSample.js
[applianceslistclusterusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListClusterUserCredentialSample.js
[applianceslistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesListOperationsSample.js
[appliancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/javascript/appliancesUpdateSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector/README.md

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

@ -0,0 +1,39 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates an Appliance in the specified Subscription and Resource Group.
*
* @summary Creates or updates an Appliance in the specified Subscription and Resource Group.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json
*/
async function createOrUpdateAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const parameters = {
distro: "AKSEdge",
infrastructureConfig: { provider: "VMWare" },
location: "West US",
};
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const result = await client.appliances.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
parameters
);
console.log(result);
}
createOrUpdateAppliance().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
*
* @summary Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesDelete.json
*/
async function deleteAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const result = await client.appliances.beginDeleteAndWait(resourceGroupName, resourceName);
console.log(result);
}
deleteAppliance().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the details of an Appliance with a specified resource group and name.
*
* @summary Gets the details of an Appliance with a specified resource group and name.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesGet.json
*/
async function getAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const result = await client.appliances.get(resourceGroupName, resourceName);
console.log(result);
}
getAppliance().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
*
* @summary Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/UpgradeGraph.json
*/
async function getApplianceUpgradeGraph() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const upgradeGraph = "stable";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const result = await client.appliances.getUpgradeGraph(
resourceGroupName,
resourceName,
upgradeGraph
);
console.log(result);
}
getApplianceUpgradeGraph().catch(console.error);

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

@ -0,0 +1,32 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance.
*
* @summary Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json
*/
async function listAppliancesByResourceGroup() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.appliances.listByResourceGroup(resourceGroupName)) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesByResourceGroup().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance
*
* @summary Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json
*/
async function listAppliancesBySubscription() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.appliances.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesBySubscription().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns the cluster customer user credentials for the dedicated appliance.
*
* @summary Returns the cluster customer user credentials for the dedicated appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json
*/
async function listClusterCustomerUserCredentialAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const result = await client.appliances.listClusterCustomerUserCredential(
resourceGroupName,
resourceName
);
console.log(result);
}
listClusterCustomerUserCredentialAppliance().catch(console.error);

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

@ -0,0 +1,30 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Returns the cluster user credentials for the dedicated appliance.
*
* @summary Returns the cluster user credentials for the dedicated appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json
*/
async function listClusterUserCredentialAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const result = await client.appliances.listClusterUserCredential(resourceGroupName, resourceName);
console.log(result);
}
listClusterUserCredentialAppliance().catch(console.error);

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

@ -0,0 +1,31 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists all available Appliances operations.
*
* @summary Lists all available Appliances operations.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListOperations.json
*/
async function listAppliancesOperations() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.appliances.listOperations()) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesOperations().catch(console.error);

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

@ -0,0 +1,32 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const { ResourceConnectorManagementClient } = require("@azure/arm-resourceconnector");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
*
* @summary Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesPatch.json
*/
async function updateAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const tags = { key: "value" };
const options = { tags };
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(credential, subscriptionId);
const result = await client.appliances.update(resourceGroupName, resourceName, options);
console.log(result);
}
updateAppliance().catch(console.error);

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

@ -0,0 +1,32 @@
{
"name": "@azure-samples/arm-resourceconnector-js-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript (Beta)",
"engines": {
"node": ">=12.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/resourceconnector/arm-resourceconnector"
},
"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/resourceconnector/arm-resourceconnector",
"dependencies": {
"@azure/arm-resourceconnector": "next",
"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,81 @@
# client library samples for TypeScript (Beta)
These sample programs show how to use the TypeScript client libraries for in some common scenarios.
| **File Name** | **Description** |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [appliancesCreateOrUpdateSample.ts][appliancescreateorupdatesample] | Creates or updates an Appliance in the specified Subscription and Resource Group. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json |
| [appliancesDeleteSample.ts][appliancesdeletesample] | Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesDelete.json |
| [appliancesGetSample.ts][appliancesgetsample] | Gets the details of an Appliance with a specified resource group and name. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesGet.json |
| [appliancesGetUpgradeGraphSample.ts][appliancesgetupgradegraphsample] | Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/UpgradeGraph.json |
| [appliancesListByResourceGroupSample.ts][applianceslistbyresourcegroupsample] | Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json |
| [appliancesListBySubscriptionSample.ts][applianceslistbysubscriptionsample] | Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json |
| [appliancesListClusterCustomerUserCredentialSample.ts][applianceslistclustercustomerusercredentialsample] | Returns the cluster customer user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json |
| [appliancesListClusterUserCredentialSample.ts][applianceslistclusterusercredentialsample] | Returns the cluster user credentials for the dedicated appliance. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json |
| [appliancesListOperationsSample.ts][applianceslistoperationssample] | Lists all available Appliances operations. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListOperations.json |
| [appliancesUpdateSample.ts][appliancesupdatesample] | Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription. x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesPatch.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
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/appliancesCreateOrUpdateSample.js
```
Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform):
```bash
npx cross-env node dist/appliancesCreateOrUpdateSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[appliancescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesCreateOrUpdateSample.ts
[appliancesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesDeleteSample.ts
[appliancesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetSample.ts
[appliancesgetupgradegraphsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesGetUpgradeGraphSample.ts
[applianceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListByResourceGroupSample.ts
[applianceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListBySubscriptionSample.ts
[applianceslistclustercustomerusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterCustomerUserCredentialSample.ts
[applianceslistclusterusercredentialsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListClusterUserCredentialSample.ts
[applianceslistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesListOperationsSample.ts
[appliancesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/resourceconnector/arm-resourceconnector/samples/v1-beta/typescript/src/appliancesUpdateSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-resourceconnector?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/resourceconnector/arm-resourceconnector/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

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

@ -0,0 +1,41 @@
{
"name": "@azure-samples/arm-resourceconnector-ts-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript (Beta)",
"engines": {
"node": ">=12.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/resourceconnector/arm-resourceconnector"
},
"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/resourceconnector/arm-resourceconnector",
"dependencies": {
"@azure/arm-resourceconnector": "next",
"dotenv": "latest",
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"@types/node": "^12.0.0",
"typescript": "~4.4.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,45 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
Appliance,
ResourceConnectorManagementClient
} from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Creates or updates an Appliance in the specified Subscription and Resource Group.
*
* @summary Creates or updates an Appliance in the specified Subscription and Resource Group.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesCreate_Update.json
*/
async function createOrUpdateAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const parameters: Appliance = {
distro: "AKSEdge",
infrastructureConfig: { provider: "VMWare" },
location: "West US"
};
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.beginCreateOrUpdateAndWait(
resourceGroupName,
resourceName,
parameters
);
console.log(result);
}
createOrUpdateAppliance().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
*
* @summary Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesDelete.json
*/
async function deleteAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.beginDeleteAndWait(
resourceGroupName,
resourceName
);
console.log(result);
}
deleteAppliance().catch(console.error);

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

@ -0,0 +1,33 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the details of an Appliance with a specified resource group and name.
*
* @summary Gets the details of an Appliance with a specified resource group and name.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesGet.json
*/
async function getAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.get(resourceGroupName, resourceName);
console.log(result);
}
getAppliance().catch(console.error);

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

@ -0,0 +1,38 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
*
* @summary Gets the upgrade graph of an Appliance with a specified resource group and name and specific release train.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/UpgradeGraph.json
*/
async function getApplianceUpgradeGraph() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const upgradeGraph = "stable";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.getUpgradeGraph(
resourceGroupName,
resourceName,
upgradeGraph
);
console.log(result);
}
getApplianceUpgradeGraph().catch(console.error);

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

@ -0,0 +1,37 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance.
*
* @summary Gets a list of Appliances in the specified subscription and resource group. The operation returns properties of each Appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListByResourceGroup.json
*/
async function listAppliancesByResourceGroup() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.appliances.listByResourceGroup(
resourceGroupName
)) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesByResourceGroup().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance
*
* @summary Gets a list of Appliances in the specified subscription. The operation returns properties of each Appliance
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListBySubscription.json
*/
async function listAppliancesBySubscription() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.appliances.listBySubscription()) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesBySubscription().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns the cluster customer user credentials for the dedicated appliance.
*
* @summary Returns the cluster customer user credentials for the dedicated appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterCustomerUserCredential.json
*/
async function listClusterCustomerUserCredentialAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.listClusterCustomerUserCredential(
resourceGroupName,
resourceName
);
console.log(result);
}
listClusterCustomerUserCredentialAppliance().catch(console.error);

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

@ -0,0 +1,36 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Returns the cluster user credentials for the dedicated appliance.
*
* @summary Returns the cluster user credentials for the dedicated appliance.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListClusterUserCredential.json
*/
async function listClusterUserCredentialAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.listClusterUserCredential(
resourceGroupName,
resourceName
);
console.log(result);
}
listClusterUserCredentialAppliance().catch(console.error);

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ResourceConnectorManagementClient } from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Lists all available Appliances operations.
*
* @summary Lists all available Appliances operations.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesListOperations.json
*/
async function listAppliancesOperations() {
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const resArray = new Array();
for await (let item of client.appliances.listOperations()) {
resArray.push(item);
}
console.log(resArray);
}
listAppliancesOperations().catch(console.error);

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

@ -0,0 +1,42 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
AppliancesUpdateOptionalParams,
ResourceConnectorManagementClient
} from "@azure/arm-resourceconnector";
import { DefaultAzureCredential } from "@azure/identity";
/**
* This sample demonstrates how to Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
*
* @summary Updates an Appliance with the specified Resource Name in the specified Resource Group and Subscription.
* x-ms-original-file: specification/resourceconnector/resource-manager/Microsoft.ResourceConnector/preview/2022-04-15-preview/examples/AppliancesPatch.json
*/
async function updateAppliance() {
const subscriptionId = "11111111-2222-3333-4444-555555555555";
const resourceGroupName = "testresourcegroup";
const resourceName = "appliance01";
const tags = { key: "value" };
const options: AppliancesUpdateOptionalParams = { tags };
const credential = new DefaultAzureCredential();
const client = new ResourceConnectorManagementClient(
credential,
subscriptionId
);
const result = await client.appliances.update(
resourceGroupName,
resourceName,
options
);
console.log(result);
}
updateAppliance().catch(console.error);

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

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"alwaysStrict": true,
"outDir": "dist",
"rootDir": "src"
},
"include": [
"src/**.ts"
]
}

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

@ -0,0 +1,12 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 * from "./models";
export { ResourceConnectorManagementClient } from "./resourceConnectorManagementClient";
export * from "./operationsInterfaces";

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

@ -0,0 +1,34 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
export class LroImpl<T> implements LongRunningOperation<T> {
constructor(
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
private args: Record<string, unknown>,
private spec: {
readonly requestBody?: unknown;
readonly path?: string;
readonly httpMethod: string;
} & Record<string, any>,
public requestPath: string = spec.path!,
public requestMethod: string = spec.httpMethod
) {}
public async sendInitialRequest(): Promise<LroResponse<T>> {
return this.sendOperationFn(this.args, this.spec);
}
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
const { requestBody, ...restSpec } = this.spec;
return this.sendOperationFn(this.args, {
...restSpec,
path,
httpMethod: "GET"
});
}
}

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

@ -0,0 +1,684 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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";
/** Lists of Appliances operations. */
export interface ApplianceOperationsList {
/** Next page of operations. */
nextLink?: string;
/** Array of applianceOperation */
value: ApplianceOperation[];
}
/** Appliances operation. */
export interface ApplianceOperation {
/**
* Is this Operation a data plane operation
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly isDataAction?: boolean;
/**
* The name of the compute operation.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The origin of the compute operation.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly origin?: string;
/**
* The description of the operation.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly description?: string;
/**
* The display name of the compute operation.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly operation?: string;
/**
* The resource provider for the operation.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provider?: string;
/**
* The display name of the resource the operation applies to.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly resource?: string;
}
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
export interface ErrorResponse {
/** The error object. */
error?: ErrorDetail;
}
/** The error detail. */
export interface ErrorDetail {
/**
* The error code.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly code?: string;
/**
* The error message.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly message?: string;
/**
* The error target.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly target?: string;
/**
* The error details.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly details?: ErrorDetail[];
/**
* The error additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly additionalInfo?: ErrorAdditionalInfo[];
}
/** The resource management error additional info. */
export interface ErrorAdditionalInfo {
/**
* The additional info type.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/**
* The additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly info?: Record<string, unknown>;
}
/** The List Appliances operation response. */
export interface ApplianceListResult {
/**
* The URL to use for getting the next set of results.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly nextLink?: string;
/**
* The list of Appliances.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly value?: Appliance[];
}
/** Identity for the resource. */
export interface Identity {
/**
* The principal ID of resource identity.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly principalId?: string;
/**
* The tenant ID of resource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly tenantId?: string;
/** The identity type. */
type?: ResourceIdentityType;
}
/** Contains infrastructure information about the Appliance */
export interface AppliancePropertiesInfrastructureConfig {
/** Information about the connected appliance. */
provider?: Provider;
}
/** 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;
}
/** The Appliances patchable resource definition. */
export interface PatchableAppliance {
/** Resource tags */
tags?: { [propertyName: string]: string };
}
/** The List Cluster Customer User Credential Results appliance. */
export interface ApplianceListClusterCustomerUserCredentialResults {
/**
* The list of appliance kubeconfigs.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly kubeconfigs?: ApplianceCredentialKubeconfig[];
/**
* Map of Customer User Public and Private SSH Keys
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly sshKeys?: { [propertyName: string]: SSHKey };
}
/** Cluster User Credential appliance. */
export interface ApplianceCredentialKubeconfig {
/**
* Name which contains the role of the kubeconfig.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: AccessProfileType;
/**
* Contains the kubeconfig value.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly value?: string;
}
/** Appliance SSHKey definition. */
export interface SSHKey {
/** User Private Key. */
privateKey?: string;
/** User Public Key. */
publicKey?: string;
}
/** The List Cluster User Credential appliance. */
export interface ApplianceListCredentialResults {
/**
* Contains the REP (rendezvous endpoint) and Listener access token from notification service (NS).
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly hybridConnectionConfig?: HybridConnectionConfig;
/**
* The list of appliance kubeconfigs.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly kubeconfigs?: ApplianceCredentialKubeconfig[];
}
/** Contains the REP (rendezvous endpoint) and “Listener” access token from notification service (NS). */
export interface HybridConnectionConfig {
/**
* Timestamp when this token will be expired.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly expirationTime?: number;
/**
* Name of the connection
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly hybridConnectionName?: string;
/**
* Name of the notification service.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly relay?: string;
/**
* Listener access token
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly token?: string;
}
/** The Upgrade Graph for appliance. */
export interface UpgradeGraph {
/**
* The appliance resource path
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The release train name.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/** The properties of supported version */
properties?: UpgradeGraphProperties;
}
/** The Upgrade Graph Properties for appliance. */
export interface UpgradeGraphProperties {
/**
* The current appliance version
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly applianceVersion?: string;
/**
* This contains the current version and supported upgrade versions.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly supportedVersions?: SupportedVersion[];
}
/** The SupportedVersion object for appliance. */
export interface SupportedVersion {
/**
* This is the metadata of the supported newer version.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly metadata?: SupportedVersionMetadata;
/**
* The newer version available for upgrade.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly version?: string;
}
/** The SupportedVersionMetadata object for appliance. */
export interface SupportedVersionMetadata {
/**
* The newer supported version catalog version.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly catalogVersion?: SupportedVersionCatalogVersion;
}
/** The SupportedVersionCatalogVersion object for appliance. */
export interface SupportedVersionCatalogVersion {
/**
* The newer supported version catalog version data.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly data?: SupportedVersionCatalogVersionData;
/**
* The catalog version name for the version available for upgrade.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The catalog version namespace for the version available for upgrade.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly namespace?: string;
}
/** The SupportedVersionCatalogVersionData object for appliance. */
export interface SupportedVersionCatalogVersionData {
/**
* The image audience name for the version available for upgrade.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly audience?: string;
/**
* The image catalog name for the version available for upgrade.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly catalog?: string;
/**
* The image offer name for the version available for upgrade.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly offer?: string;
/**
* The image version for the version available for upgrade.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly version?: 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;
}
/** Appliances definition. */
export interface Appliance extends TrackedResource {
/** Identity for the resource. */
identity?: Identity;
/**
* Metadata pertaining to creation and last modification of the resource
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly systemData?: SystemData;
/** Represents a supported Fabric/Infra. (AKSEdge etc...). */
distro?: Distro;
/** Contains infrastructure information about the Appliance */
infrastructureConfig?: AppliancePropertiesInfrastructureConfig;
/**
* The current deployment or provisioning state, which only appears in the response.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: string;
/** Certificates pair used to download MSI certificate from HIS */
publicKey?: string;
/**
* Appliances health and state of connection to on-prem
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly status?: Status;
/** Version of the Appliance */
version?: string;
}
/** Known values of {@link ResourceIdentityType} that the service accepts. */
export enum KnownResourceIdentityType {
/** SystemAssigned */
SystemAssigned = "SystemAssigned",
/** None */
None = "None"
}
/**
* Defines values for ResourceIdentityType. \
* {@link KnownResourceIdentityType} can be used interchangeably with ResourceIdentityType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **SystemAssigned** \
* **None**
*/
export type ResourceIdentityType = string;
/** Known values of {@link Distro} that the service accepts. */
export enum KnownDistro {
/** AKSEdge */
AKSEdge = "AKSEdge"
}
/**
* Defines values for Distro. \
* {@link KnownDistro} can be used interchangeably with Distro,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **AKSEdge**
*/
export type Distro = string;
/** Known values of {@link Provider} that the service accepts. */
export enum KnownProvider {
/** VMWare */
VMWare = "VMWare",
/** HCI */
HCI = "HCI",
/** Scvmm */
Scvmm = "SCVMM",
/** KubeVirt */
KubeVirt = "KubeVirt",
/** OpenStack */
OpenStack = "OpenStack"
}
/**
* Defines values for Provider. \
* {@link KnownProvider} can be used interchangeably with Provider,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **VMWare** \
* **HCI** \
* **SCVMM** \
* **KubeVirt** \
* **OpenStack**
*/
export type Provider = string;
/** Known values of {@link Status} that the service accepts. */
export enum KnownStatus {
/** WaitingForHeartbeat */
WaitingForHeartbeat = "WaitingForHeartbeat",
/** Validating */
Validating = "Validating",
/** Connecting */
Connecting = "Connecting",
/** Connected */
Connected = "Connected",
/** Running */
Running = "Running",
/** PreparingForUpgrade */
PreparingForUpgrade = "PreparingForUpgrade",
/** UpgradePrerequisitesCompleted */
UpgradePrerequisitesCompleted = "UpgradePrerequisitesCompleted",
/** PreUpgrade */
PreUpgrade = "PreUpgrade",
/** UpdatingCloudOperator */
UpdatingCloudOperator = "UpdatingCloudOperator",
/** WaitingForCloudOperator */
WaitingForCloudOperator = "WaitingForCloudOperator",
/** UpdatingCapi */
UpdatingCapi = "UpdatingCAPI",
/** UpdatingCluster */
UpdatingCluster = "UpdatingCluster",
/** PostUpgrade */
PostUpgrade = "PostUpgrade",
/** UpgradeComplete */
UpgradeComplete = "UpgradeComplete",
/** UpgradeClusterExtensionFailedToDelete */
UpgradeClusterExtensionFailedToDelete = "UpgradeClusterExtensionFailedToDelete",
/** UpgradeFailed */
UpgradeFailed = "UpgradeFailed",
/** Offline */
Offline = "Offline",
/** None */
None = "None"
}
/**
* Defines values for Status. \
* {@link KnownStatus} can be used interchangeably with Status,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **WaitingForHeartbeat** \
* **Validating** \
* **Connecting** \
* **Connected** \
* **Running** \
* **PreparingForUpgrade** \
* **UpgradePrerequisitesCompleted** \
* **PreUpgrade** \
* **UpdatingCloudOperator** \
* **WaitingForCloudOperator** \
* **UpdatingCAPI** \
* **UpdatingCluster** \
* **PostUpgrade** \
* **UpgradeComplete** \
* **UpgradeClusterExtensionFailedToDelete** \
* **UpgradeFailed** \
* **Offline** \
* **None**
*/
export type Status = 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;
/** Known values of {@link AccessProfileType} that the service accepts. */
export enum KnownAccessProfileType {
/** ClusterUser */
ClusterUser = "clusterUser",
/** ClusterCustomerUser */
ClusterCustomerUser = "clusterCustomerUser"
}
/**
* Defines values for AccessProfileType. \
* {@link KnownAccessProfileType} can be used interchangeably with AccessProfileType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **clusterUser** \
* **clusterCustomerUser**
*/
export type AccessProfileType = string;
/** Known values of {@link SSHKeyType} that the service accepts. */
export enum KnownSSHKeyType {
/** SSHCustomerUser */
SSHCustomerUser = "SSHCustomerUser"
}
/**
* Defines values for SSHKeyType. \
* {@link KnownSSHKeyType} can be used interchangeably with SSHKeyType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **SSHCustomerUser**
*/
export type SSHKeyType = string;
/** Optional parameters. */
export interface AppliancesListOperationsOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listOperations operation. */
export type AppliancesListOperationsResponse = ApplianceOperationsList;
/** Optional parameters. */
export interface AppliancesListBySubscriptionOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listBySubscription operation. */
export type AppliancesListBySubscriptionResponse = ApplianceListResult;
/** Optional parameters. */
export interface AppliancesListByResourceGroupOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listByResourceGroup operation. */
export type AppliancesListByResourceGroupResponse = ApplianceListResult;
/** Optional parameters. */
export interface AppliancesGetOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the get operation. */
export type AppliancesGetResponse = Appliance;
/** Optional parameters. */
export interface AppliancesCreateOrUpdateOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Contains response data for the createOrUpdate operation. */
export type AppliancesCreateOrUpdateResponse = Appliance;
/** Optional parameters. */
export interface AppliancesDeleteOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
/** Optional parameters. */
export interface AppliancesUpdateOptionalParams
extends coreClient.OperationOptions {
/** Resource tags */
tags?: { [propertyName: string]: string };
}
/** Contains response data for the update operation. */
export type AppliancesUpdateResponse = Appliance;
/** Optional parameters. */
export interface AppliancesListClusterCustomerUserCredentialOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listClusterCustomerUserCredential operation. */
export type AppliancesListClusterCustomerUserCredentialResponse = ApplianceListClusterCustomerUserCredentialResults;
/** Optional parameters. */
export interface AppliancesListClusterUserCredentialOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listClusterUserCredential operation. */
export type AppliancesListClusterUserCredentialResponse = ApplianceListCredentialResults;
/** Optional parameters. */
export interface AppliancesGetUpgradeGraphOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the getUpgradeGraph operation. */
export type AppliancesGetUpgradeGraphResponse = UpgradeGraph;
/** Optional parameters. */
export interface AppliancesListOperationsNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listOperationsNext operation. */
export type AppliancesListOperationsNextResponse = ApplianceOperationsList;
/** Optional parameters. */
export interface AppliancesListBySubscriptionNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listBySubscriptionNext operation. */
export type AppliancesListBySubscriptionNextResponse = ApplianceListResult;
/** Optional parameters. */
export interface AppliancesListByResourceGroupNextOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the listByResourceGroupNext operation. */
export type AppliancesListByResourceGroupNextResponse = ApplianceListResult;
/** Optional parameters. */
export interface ResourceConnectorManagementClientOptionalParams
extends coreClient.ServiceClientOptions {
/** server parameter */
$host?: string;
/** Api Version */
apiVersion?: string;
/** Overrides client endpoint. */
endpoint?: string;
}

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

@ -0,0 +1,748 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 ApplianceOperationsList: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ApplianceOperationsList",
modelProperties: {
nextLink: {
serializedName: "nextLink",
type: {
name: "String"
}
},
value: {
serializedName: "value",
required: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ApplianceOperation"
}
}
}
}
}
}
};
export const ApplianceOperation: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ApplianceOperation",
modelProperties: {
isDataAction: {
serializedName: "isDataAction",
readOnly: true,
type: {
name: "Boolean"
}
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
origin: {
serializedName: "origin",
readOnly: true,
type: {
name: "String"
}
},
description: {
serializedName: "display.description",
readOnly: true,
type: {
name: "String"
}
},
operation: {
serializedName: "display.operation",
readOnly: true,
type: {
name: "String"
}
},
provider: {
serializedName: "display.provider",
readOnly: true,
type: {
name: "String"
}
},
resource: {
serializedName: "display.resource",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const ErrorResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorResponse",
modelProperties: {
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
}
};
export const ErrorDetail: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorDetail",
modelProperties: {
code: {
serializedName: "code",
readOnly: true,
type: {
name: "String"
}
},
message: {
serializedName: "message",
readOnly: true,
type: {
name: "String"
}
},
target: {
serializedName: "target",
readOnly: true,
type: {
name: "String"
}
},
details: {
serializedName: "details",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorDetail"
}
}
}
},
additionalInfo: {
serializedName: "additionalInfo",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorAdditionalInfo"
}
}
}
}
}
}
};
export const ErrorAdditionalInfo: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorAdditionalInfo",
modelProperties: {
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String"
}
},
info: {
serializedName: "info",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "any" } }
}
}
}
}
};
export const ApplianceListResult: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ApplianceListResult",
modelProperties: {
nextLink: {
serializedName: "nextLink",
readOnly: true,
type: {
name: "String"
}
},
value: {
serializedName: "value",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "Appliance"
}
}
}
}
}
}
};
export const Identity: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Identity",
modelProperties: {
principalId: {
serializedName: "principalId",
readOnly: true,
type: {
name: "String"
}
},
tenantId: {
serializedName: "tenantId",
readOnly: true,
type: {
name: "String"
}
},
type: {
serializedName: "type",
type: {
name: "String"
}
}
}
}
};
export const AppliancePropertiesInfrastructureConfig: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "AppliancePropertiesInfrastructureConfig",
modelProperties: {
provider: {
serializedName: "provider",
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 PatchableAppliance: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "PatchableAppliance",
modelProperties: {
tags: {
serializedName: "tags",
type: {
name: "Dictionary",
value: { type: { name: "String" } }
}
}
}
}
};
export const ApplianceListClusterCustomerUserCredentialResults: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ApplianceListClusterCustomerUserCredentialResults",
modelProperties: {
kubeconfigs: {
serializedName: "kubeconfigs",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ApplianceCredentialKubeconfig"
}
}
}
},
sshKeys: {
serializedName: "sshKeys",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "Composite", className: "SSHKey" } }
}
}
}
}
};
export const ApplianceCredentialKubeconfig: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ApplianceCredentialKubeconfig",
modelProperties: {
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
value: {
serializedName: "value",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const SSHKey: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SSHKey",
modelProperties: {
privateKey: {
serializedName: "privateKey",
type: {
name: "String"
}
},
publicKey: {
serializedName: "publicKey",
type: {
name: "String"
}
}
}
}
};
export const ApplianceListCredentialResults: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ApplianceListCredentialResults",
modelProperties: {
hybridConnectionConfig: {
serializedName: "hybridConnectionConfig",
type: {
name: "Composite",
className: "HybridConnectionConfig"
}
},
kubeconfigs: {
serializedName: "kubeconfigs",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ApplianceCredentialKubeconfig"
}
}
}
}
}
}
};
export const HybridConnectionConfig: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "HybridConnectionConfig",
modelProperties: {
expirationTime: {
serializedName: "expirationTime",
readOnly: true,
type: {
name: "Number"
}
},
hybridConnectionName: {
serializedName: "hybridConnectionName",
readOnly: true,
type: {
name: "String"
}
},
relay: {
serializedName: "relay",
readOnly: true,
type: {
name: "String"
}
},
token: {
serializedName: "token",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const UpgradeGraph: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "UpgradeGraph",
modelProperties: {
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String"
}
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
properties: {
serializedName: "properties",
type: {
name: "Composite",
className: "UpgradeGraphProperties"
}
}
}
}
};
export const UpgradeGraphProperties: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "UpgradeGraphProperties",
modelProperties: {
applianceVersion: {
serializedName: "applianceVersion",
readOnly: true,
type: {
name: "String"
}
},
supportedVersions: {
serializedName: "supportedVersions",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "SupportedVersion"
}
}
}
}
}
}
};
export const SupportedVersion: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SupportedVersion",
modelProperties: {
metadata: {
serializedName: "metadata",
type: {
name: "Composite",
className: "SupportedVersionMetadata"
}
},
version: {
serializedName: "version",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const SupportedVersionMetadata: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SupportedVersionMetadata",
modelProperties: {
catalogVersion: {
serializedName: "catalogVersion",
type: {
name: "Composite",
className: "SupportedVersionCatalogVersion"
}
}
}
}
};
export const SupportedVersionCatalogVersion: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SupportedVersionCatalogVersion",
modelProperties: {
data: {
serializedName: "data",
type: {
name: "Composite",
className: "SupportedVersionCatalogVersionData"
}
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String"
}
},
namespace: {
serializedName: "namespace",
readOnly: true,
type: {
name: "String"
}
}
}
}
};
export const SupportedVersionCatalogVersionData: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SupportedVersionCatalogVersionData",
modelProperties: {
audience: {
serializedName: "audience",
readOnly: true,
type: {
name: "String"
}
},
catalog: {
serializedName: "catalog",
readOnly: true,
type: {
name: "String"
}
},
offer: {
serializedName: "offer",
readOnly: true,
type: {
name: "String"
}
},
version: {
serializedName: "version",
readOnly: true,
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 Appliance: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Appliance",
modelProperties: {
...TrackedResource.type.modelProperties,
identity: {
serializedName: "identity",
type: {
name: "Composite",
className: "Identity"
}
},
systemData: {
serializedName: "systemData",
type: {
name: "Composite",
className: "SystemData"
}
},
distro: {
defaultValue: "AKSEdge",
serializedName: "properties.distro",
type: {
name: "String"
}
},
infrastructureConfig: {
serializedName: "properties.infrastructureConfig",
type: {
name: "Composite",
className: "AppliancePropertiesInfrastructureConfig"
}
},
provisioningState: {
serializedName: "properties.provisioningState",
readOnly: true,
type: {
name: "String"
}
},
publicKey: {
serializedName: "properties.publicKey",
type: {
name: "String"
}
},
status: {
serializedName: "properties.status",
readOnly: true,
type: {
name: "String"
}
},
version: {
serializedName: "properties.version",
type: {
name: "String"
}
}
}
}
};

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

@ -0,0 +1,145 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 {
Appliance as ApplianceMapper,
PatchableAppliance as PatchableApplianceMapper
} 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: "2022-04-15-preview",
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 resourceName: OperationURLParameter = {
parameterPath: "resourceName",
mapper: {
constraints: {
Pattern: new RegExp(
"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"
),
MaxLength: 63,
MinLength: 1
},
serializedName: "resourceName",
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 parameters: OperationParameter = {
parameterPath: "parameters",
mapper: ApplianceMapper
};
export const tags: OperationParameter = {
parameterPath: ["options", "tags"],
mapper: PatchableApplianceMapper
};
export const upgradeGraph: OperationURLParameter = {
parameterPath: "upgradeGraph",
mapper: {
serializedName: "upgradeGraph",
required: true,
type: {
name: "String"
}
}
};
export const nextLink: OperationURLParameter = {
parameterPath: "nextLink",
mapper: {
serializedName: "nextLink",
required: true,
type: {
name: "String"
}
},
skipEncoding: true
};

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

@ -0,0 +1,839 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 { Appliances } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { ResourceConnectorManagementClient } from "../resourceConnectorManagementClient";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
import { LroImpl } from "../lroImpl";
import {
ApplianceOperation,
AppliancesListOperationsNextOptionalParams,
AppliancesListOperationsOptionalParams,
Appliance,
AppliancesListBySubscriptionNextOptionalParams,
AppliancesListBySubscriptionOptionalParams,
AppliancesListByResourceGroupNextOptionalParams,
AppliancesListByResourceGroupOptionalParams,
AppliancesListOperationsResponse,
AppliancesListBySubscriptionResponse,
AppliancesListByResourceGroupResponse,
AppliancesGetOptionalParams,
AppliancesGetResponse,
AppliancesCreateOrUpdateOptionalParams,
AppliancesCreateOrUpdateResponse,
AppliancesDeleteOptionalParams,
AppliancesUpdateOptionalParams,
AppliancesUpdateResponse,
AppliancesListClusterCustomerUserCredentialOptionalParams,
AppliancesListClusterCustomerUserCredentialResponse,
AppliancesListClusterUserCredentialOptionalParams,
AppliancesListClusterUserCredentialResponse,
AppliancesGetUpgradeGraphOptionalParams,
AppliancesGetUpgradeGraphResponse,
AppliancesListOperationsNextResponse,
AppliancesListBySubscriptionNextResponse,
AppliancesListByResourceGroupNextResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Class containing Appliances operations. */
export class AppliancesImpl implements Appliances {
private readonly client: ResourceConnectorManagementClient;
/**
* Initialize a new instance of the class Appliances class.
* @param client Reference to the service client
*/
constructor(client: ResourceConnectorManagementClient) {
this.client = client;
}
/**
* Lists all available Appliances operations.
* @param options The options parameters.
*/
public listOperations(
options?: AppliancesListOperationsOptionalParams
): PagedAsyncIterableIterator<ApplianceOperation> {
const iter = this.listOperationsPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listOperationsPagingPage(options);
}
};
}
private async *listOperationsPagingPage(
options?: AppliancesListOperationsOptionalParams
): AsyncIterableIterator<ApplianceOperation[]> {
let result = await this._listOperations(options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listOperationsNext(continuationToken, options);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listOperationsPagingAll(
options?: AppliancesListOperationsOptionalParams
): AsyncIterableIterator<ApplianceOperation> {
for await (const page of this.listOperationsPagingPage(options)) {
yield* page;
}
}
/**
* Gets a list of Appliances in the specified subscription. The operation returns properties of each
* Appliance
* @param options The options parameters.
*/
public listBySubscription(
options?: AppliancesListBySubscriptionOptionalParams
): PagedAsyncIterableIterator<Appliance> {
const iter = this.listBySubscriptionPagingAll(options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listBySubscriptionPagingPage(options);
}
};
}
private async *listBySubscriptionPagingPage(
options?: AppliancesListBySubscriptionOptionalParams
): AsyncIterableIterator<Appliance[]> {
let result = await this._listBySubscription(options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listBySubscriptionNext(continuationToken, options);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listBySubscriptionPagingAll(
options?: AppliancesListBySubscriptionOptionalParams
): AsyncIterableIterator<Appliance> {
for await (const page of this.listBySubscriptionPagingPage(options)) {
yield* page;
}
}
/**
* Gets a list of Appliances in the specified subscription and resource group. The operation returns
* properties of each Appliance.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
public listByResourceGroup(
resourceGroupName: string,
options?: AppliancesListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<Appliance> {
const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},
byPage: () => {
return this.listByResourceGroupPagingPage(resourceGroupName, options);
}
};
}
private async *listByResourceGroupPagingPage(
resourceGroupName: string,
options?: AppliancesListByResourceGroupOptionalParams
): AsyncIterableIterator<Appliance[]> {
let result = await this._listByResourceGroup(resourceGroupName, options);
yield result.value || [];
let continuationToken = result.nextLink;
while (continuationToken) {
result = await this._listByResourceGroupNext(
resourceGroupName,
continuationToken,
options
);
continuationToken = result.nextLink;
yield result.value || [];
}
}
private async *listByResourceGroupPagingAll(
resourceGroupName: string,
options?: AppliancesListByResourceGroupOptionalParams
): AsyncIterableIterator<Appliance> {
for await (const page of this.listByResourceGroupPagingPage(
resourceGroupName,
options
)) {
yield* page;
}
}
/**
* Lists all available Appliances operations.
* @param options The options parameters.
*/
private _listOperations(
options?: AppliancesListOperationsOptionalParams
): Promise<AppliancesListOperationsResponse> {
return this.client.sendOperationRequest(
{ options },
listOperationsOperationSpec
);
}
/**
* Gets a list of Appliances in the specified subscription. The operation returns properties of each
* Appliance
* @param options The options parameters.
*/
private _listBySubscription(
options?: AppliancesListBySubscriptionOptionalParams
): Promise<AppliancesListBySubscriptionResponse> {
return this.client.sendOperationRequest(
{ options },
listBySubscriptionOperationSpec
);
}
/**
* Gets a list of Appliances in the specified subscription and resource group. The operation returns
* properties of each Appliance.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
private _listByResourceGroup(
resourceGroupName: string,
options?: AppliancesListByResourceGroupOptionalParams
): Promise<AppliancesListByResourceGroupResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, options },
listByResourceGroupOperationSpec
);
}
/**
* Gets the details of an Appliance with a specified resource group and name.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
resourceName: string,
options?: AppliancesGetOptionalParams
): Promise<AppliancesGetResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, options },
getOperationSpec
);
}
/**
* Creates or updates an Appliance in the specified Subscription and Resource Group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param parameters Parameters supplied to create or update an Appliance.
* @param options The options parameters.
*/
async beginCreateOrUpdate(
resourceGroupName: string,
resourceName: string,
parameters: Appliance,
options?: AppliancesCreateOrUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState<AppliancesCreateOrUpdateResponse>,
AppliancesCreateOrUpdateResponse
>
> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<AppliancesCreateOrUpdateResponse> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback
}
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON()
}
};
};
const lro = new LroImpl(
sendOperation,
{ resourceGroupName, resourceName, parameters, options },
createOrUpdateOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
* Creates or updates an Appliance in the specified Subscription and Resource Group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param parameters Parameters supplied to create or update an Appliance.
* @param options The options parameters.
*/
async beginCreateOrUpdateAndWait(
resourceGroupName: string,
resourceName: string,
parameters: Appliance,
options?: AppliancesCreateOrUpdateOptionalParams
): Promise<AppliancesCreateOrUpdateResponse> {
const poller = await this.beginCreateOrUpdate(
resourceGroupName,
resourceName,
parameters,
options
);
return poller.pollUntilDone();
}
/**
* Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
async beginDelete(
resourceGroupName: string,
resourceName: string,
options?: AppliancesDeleteOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>> {
const directSendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
): Promise<void> => {
return this.client.sendOperationRequest(args, spec);
};
const sendOperation = async (
args: coreClient.OperationArguments,
spec: coreClient.OperationSpec
) => {
let currentRawResponse:
| coreClient.FullOperationResponse
| undefined = undefined;
const providedCallback = args.options?.onResponse;
const callback: coreClient.RawResponseCallback = (
rawResponse: coreClient.FullOperationResponse,
flatResponse: unknown
) => {
currentRawResponse = rawResponse;
providedCallback?.(rawResponse, flatResponse);
};
const updatedArgs = {
...args,
options: {
...args.options,
onResponse: callback
}
};
const flatResponse = await directSendOperation(updatedArgs, spec);
return {
flatResponse,
rawResponse: {
statusCode: currentRawResponse!.status,
body: currentRawResponse!.parsedBody,
headers: currentRawResponse!.headers.toJSON()
}
};
};
const lro = new LroImpl(
sendOperation,
{ resourceGroupName, resourceName, options },
deleteOperationSpec
);
const poller = new LroEngine(lro, {
resumeFrom: options?.resumeFrom,
intervalInMs: options?.updateIntervalInMs,
lroResourceLocationConfig: "azure-async-operation"
});
await poller.poll();
return poller;
}
/**
* Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
async beginDeleteAndWait(
resourceGroupName: string,
resourceName: string,
options?: AppliancesDeleteOptionalParams
): Promise<void> {
const poller = await this.beginDelete(
resourceGroupName,
resourceName,
options
);
return poller.pollUntilDone();
}
/**
* Updates an Appliance with the specified Resource Name in the specified Resource Group and
* Subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
resourceName: string,
options?: AppliancesUpdateOptionalParams
): Promise<AppliancesUpdateResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, options },
updateOperationSpec
);
}
/**
* Returns the cluster customer user credentials for the dedicated appliance.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
listClusterCustomerUserCredential(
resourceGroupName: string,
resourceName: string,
options?: AppliancesListClusterCustomerUserCredentialOptionalParams
): Promise<AppliancesListClusterCustomerUserCredentialResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, options },
listClusterCustomerUserCredentialOperationSpec
);
}
/**
* Returns the cluster user credentials for the dedicated appliance.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
listClusterUserCredential(
resourceGroupName: string,
resourceName: string,
options?: AppliancesListClusterUserCredentialOptionalParams
): Promise<AppliancesListClusterUserCredentialResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, options },
listClusterUserCredentialOperationSpec
);
}
/**
* Gets the upgrade graph of an Appliance with a specified resource group and name and specific release
* train.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param upgradeGraph Upgrade graph version, ex - stable
* @param options The options parameters.
*/
getUpgradeGraph(
resourceGroupName: string,
resourceName: string,
upgradeGraph: string,
options?: AppliancesGetUpgradeGraphOptionalParams
): Promise<AppliancesGetUpgradeGraphResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, resourceName, upgradeGraph, options },
getUpgradeGraphOperationSpec
);
}
/**
* ListOperationsNext
* @param nextLink The nextLink from the previous successful call to the ListOperations method.
* @param options The options parameters.
*/
private _listOperationsNext(
nextLink: string,
options?: AppliancesListOperationsNextOptionalParams
): Promise<AppliancesListOperationsNextResponse> {
return this.client.sendOperationRequest(
{ nextLink, options },
listOperationsNextOperationSpec
);
}
/**
* ListBySubscriptionNext
* @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
* @param options The options parameters.
*/
private _listBySubscriptionNext(
nextLink: string,
options?: AppliancesListBySubscriptionNextOptionalParams
): Promise<AppliancesListBySubscriptionNextResponse> {
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?: AppliancesListByResourceGroupNextOptionalParams
): Promise<AppliancesListByResourceGroupNextResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, nextLink, options },
listByResourceGroupNextOperationSpec
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const listOperationsOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.ResourceConnector/operations",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplianceOperationsList
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/providers/Microsoft.ResourceConnector/appliances",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplianceListResult
},
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.ResourceConnector/appliances",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplianceListResult
},
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.ResourceConnector/appliances/{resourceName}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Appliance
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept],
serializer
};
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.Appliance
},
201: {
bodyMapper: Mappers.Appliance
},
202: {
bodyMapper: Mappers.Appliance
},
204: {
bodyMapper: Mappers.Appliance
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: Parameters.parameters,
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const deleteOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}",
httpMethod: "DELETE",
responses: {
200: {},
201: {},
202: {},
204: {},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept],
serializer
};
const updateOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}",
httpMethod: "PATCH",
responses: {
200: {
bodyMapper: Mappers.Appliance
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
requestBody: {
parameterPath: { tags: ["options", "tags"] },
mapper: { ...Mappers.PatchableAppliance, required: true }
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const listClusterCustomerUserCredentialOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/listClusterCustomerUserCredential",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.ApplianceListClusterCustomerUserCredentialResults
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept],
serializer
};
const listClusterUserCredentialOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/listClusterUserCredential",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.ApplianceListCredentialResults
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName
],
headerParameters: [Parameters.accept],
serializer
};
const getUpgradeGraphOperationSpec: coreClient.OperationSpec = {
path:
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ResourceConnector/appliances/{resourceName}/upgradeGraphs/{upgradeGraph}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.UpgradeGraph
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.resourceName,
Parameters.upgradeGraph
],
headerParameters: [Parameters.accept],
serializer
};
const listOperationsNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplianceOperationsList
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.nextLink],
headerParameters: [Parameters.accept],
serializer
};
const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplianceListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};
const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
path: "{nextLink}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ApplianceListResult
},
default: {
bodyMapper: Mappers.ErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.nextLink
],
headerParameters: [Parameters.accept],
serializer
};

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

@ -0,0 +1,9 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 "./appliances";

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

@ -0,0 +1,172 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 { PollerLike, PollOperationState } from "@azure/core-lro";
import {
ApplianceOperation,
AppliancesListOperationsOptionalParams,
Appliance,
AppliancesListBySubscriptionOptionalParams,
AppliancesListByResourceGroupOptionalParams,
AppliancesGetOptionalParams,
AppliancesGetResponse,
AppliancesCreateOrUpdateOptionalParams,
AppliancesCreateOrUpdateResponse,
AppliancesDeleteOptionalParams,
AppliancesUpdateOptionalParams,
AppliancesUpdateResponse,
AppliancesListClusterCustomerUserCredentialOptionalParams,
AppliancesListClusterCustomerUserCredentialResponse,
AppliancesListClusterUserCredentialOptionalParams,
AppliancesListClusterUserCredentialResponse,
AppliancesGetUpgradeGraphOptionalParams,
AppliancesGetUpgradeGraphResponse
} from "../models";
/// <reference lib="esnext.asynciterable" />
/** Interface representing a Appliances. */
export interface Appliances {
/**
* Lists all available Appliances operations.
* @param options The options parameters.
*/
listOperations(
options?: AppliancesListOperationsOptionalParams
): PagedAsyncIterableIterator<ApplianceOperation>;
/**
* Gets a list of Appliances in the specified subscription. The operation returns properties of each
* Appliance
* @param options The options parameters.
*/
listBySubscription(
options?: AppliancesListBySubscriptionOptionalParams
): PagedAsyncIterableIterator<Appliance>;
/**
* Gets a list of Appliances in the specified subscription and resource group. The operation returns
* properties of each Appliance.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param options The options parameters.
*/
listByResourceGroup(
resourceGroupName: string,
options?: AppliancesListByResourceGroupOptionalParams
): PagedAsyncIterableIterator<Appliance>;
/**
* Gets the details of an Appliance with a specified resource group and name.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
get(
resourceGroupName: string,
resourceName: string,
options?: AppliancesGetOptionalParams
): Promise<AppliancesGetResponse>;
/**
* Creates or updates an Appliance in the specified Subscription and Resource Group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param parameters Parameters supplied to create or update an Appliance.
* @param options The options parameters.
*/
beginCreateOrUpdate(
resourceGroupName: string,
resourceName: string,
parameters: Appliance,
options?: AppliancesCreateOrUpdateOptionalParams
): Promise<
PollerLike<
PollOperationState<AppliancesCreateOrUpdateResponse>,
AppliancesCreateOrUpdateResponse
>
>;
/**
* Creates or updates an Appliance in the specified Subscription and Resource Group.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param parameters Parameters supplied to create or update an Appliance.
* @param options The options parameters.
*/
beginCreateOrUpdateAndWait(
resourceGroupName: string,
resourceName: string,
parameters: Appliance,
options?: AppliancesCreateOrUpdateOptionalParams
): Promise<AppliancesCreateOrUpdateResponse>;
/**
* Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
beginDelete(
resourceGroupName: string,
resourceName: string,
options?: AppliancesDeleteOptionalParams
): Promise<PollerLike<PollOperationState<void>, void>>;
/**
* Deletes an Appliance with the specified Resource Name, Resource Group, and Subscription Id.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
beginDeleteAndWait(
resourceGroupName: string,
resourceName: string,
options?: AppliancesDeleteOptionalParams
): Promise<void>;
/**
* Updates an Appliance with the specified Resource Name in the specified Resource Group and
* Subscription.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
update(
resourceGroupName: string,
resourceName: string,
options?: AppliancesUpdateOptionalParams
): Promise<AppliancesUpdateResponse>;
/**
* Returns the cluster customer user credentials for the dedicated appliance.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
listClusterCustomerUserCredential(
resourceGroupName: string,
resourceName: string,
options?: AppliancesListClusterCustomerUserCredentialOptionalParams
): Promise<AppliancesListClusterCustomerUserCredentialResponse>;
/**
* Returns the cluster user credentials for the dedicated appliance.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param options The options parameters.
*/
listClusterUserCredential(
resourceGroupName: string,
resourceName: string,
options?: AppliancesListClusterUserCredentialOptionalParams
): Promise<AppliancesListClusterUserCredentialResponse>;
/**
* Gets the upgrade graph of an Appliance with a specified resource group and name and specific release
* train.
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName Appliances name.
* @param upgradeGraph Upgrade graph version, ex - stable
* @param options The options parameters.
*/
getUpgradeGraph(
resourceGroupName: string,
resourceName: string,
upgradeGraph: string,
options?: AppliancesGetUpgradeGraphOptionalParams
): Promise<AppliancesGetUpgradeGraphResponse>;
}

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

@ -0,0 +1,9 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 "./appliances";

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

@ -0,0 +1,131 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 { AppliancesImpl } from "./operations";
import { Appliances } from "./operationsInterfaces";
import { ResourceConnectorManagementClientOptionalParams } from "./models";
export class ResourceConnectorManagementClient extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
subscriptionId: string;
/**
* Initializes a new instance of the ResourceConnectorManagementClient 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?: ResourceConnectorManagementClientOptionalParams
) {
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: ResourceConnectorManagementClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials
};
const packageDetails = `azsdk-js-arm-resourceconnector/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
baseUri:
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
};
super(optionsWithDefaults);
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName
);
if (!bearerTokenAuthenticationPolicyFound) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
scopes: `${optionsWithDefaults.baseUri}/.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 || "2022-04-15-preview";
this.appliances = new AppliancesImpl(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);
}
appliances: Appliances;
}

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

@ -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.
*/
import {
Recorder,
RecorderStartOptions,
env
} from "@azure-tools/test-recorder";
import { assert } from "chai";
import { Context } from "mocha";
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
};
describe("My test", () => {
let recorder: Recorder;
beforeEach(async function(this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
});
afterEach(async function() {
await recorder.stop();
});
it("sample test", async function() {
console.log("Hi, I'm a test!");
});
});

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

@ -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-resourceconnector": [
"./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/resourceconnector/arm-resourceconnector
- sdk/resourceconnector/ci.mgmt.yml
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/resourceconnector/arm-resourceconnector
- sdk/resourceconnector/ci.mgmt.yml
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: resourceconnector
Artifacts:
- name: azure-arm-resourceconnector
safeName: azurearmresourceconnector