[mgmt] hybridconnectivity release (#26975)
https://github.com/Azure/sdk-release-request/issues/4439
This commit is contained in:
Родитель
1cd0daa460
Коммит
44aef0bde6
|
@ -467,6 +467,10 @@
|
|||
/sdk/hybridcompute/arm-hybridcompute/ @qiaozha @MaryGao
|
||||
/sdk/hybridcompute/ci.mgmt.yml @qiaozha @MaryGao
|
||||
|
||||
# PRLabel: %Mgmt
|
||||
/sdk/hybridconnectivity/arm-hybridconnectivity/ @qiaozha @MaryGao
|
||||
/sdk/hybridconnectivity/ci.mgmt.yml @qiaozha @MaryGao
|
||||
|
||||
# PRLabel: %Mgmt
|
||||
/sdk/hybridkubernetes/arm-hybridkubernetes/ @qiaozha @MaryGao
|
||||
/sdk/hybridkubernetes/ci.mgmt.yml @qiaozha @MaryGao
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -31,3 +31,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-apicenter?view=azure-node-p
|
|||
https://docs.microsoft.com/javascript/api/@azure/arm-defendereasm?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-resourcesdeploymentstacks?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-hdinsightcontainers?view=azure-node-preview
|
||||
https://docs.microsoft.com/javascript/api/@azure/arm-hybridconnectivity?view=azure-node-preview
|
||||
|
|
|
@ -2094,6 +2094,11 @@
|
|||
"packageName": "@azure/arm-defendereasm",
|
||||
"projectFolder": "sdk/defendereasm/arm-defendereasm",
|
||||
"versionPolicyName": "management"
|
||||
},
|
||||
{
|
||||
"packageName": "@azure/arm-hybridconnectivity",
|
||||
"projectFolder": "sdk/hybridconnectivity/arm-hybridconnectivity",
|
||||
"versionPolicyName": "management"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
# Release History
|
||||
|
||||
## 1.0.0-beta.1 (2023-08-30)
|
||||
|
||||
The package of @azure/arm-hybridconnectivity is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2023 Microsoft
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
|
@ -0,0 +1,108 @@
|
|||
# Azure HybridConnectivityManagementApi client library for JavaScript
|
||||
|
||||
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure HybridConnectivityManagementApi client.
|
||||
|
||||
REST API for Hybrid Connectivity
|
||||
|
||||
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridconnectivity/arm-hybridconnectivity) |
|
||||
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-hybridconnectivity) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-hybridconnectivity?view=azure-node-preview) |
|
||||
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
||||
|
||||
## Getting started
|
||||
|
||||
### Currently supported environments
|
||||
|
||||
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
||||
- Latest versions of Safari, Chrome, Edge and Firefox.
|
||||
|
||||
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- An [Azure subscription][azure_sub].
|
||||
|
||||
### Install the `@azure/arm-hybridconnectivity` package
|
||||
|
||||
Install the Azure HybridConnectivityManagementApi client library for JavaScript with `npm`:
|
||||
|
||||
```bash
|
||||
npm install @azure/arm-hybridconnectivity
|
||||
```
|
||||
|
||||
### Create and authenticate a `HybridConnectivityManagementAPI`
|
||||
|
||||
To create a client object to access the Azure HybridConnectivityManagementApi API, you will need the `endpoint` of your Azure HybridConnectivityManagementApi resource and a `credential`. The Azure HybridConnectivityManagementApi client can use Azure Active Directory credentials to authenticate.
|
||||
You can find the endpoint for your Azure HybridConnectivityManagementApi 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 HybridConnectivityManagementApi** 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 { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
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 client = new HybridConnectivityManagementAPI(new DefaultAzureCredential());
|
||||
|
||||
// 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 HybridConnectivityManagementAPI(credential);
|
||||
```
|
||||
|
||||
### 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
|
||||
|
||||
### HybridConnectivityManagementAPI
|
||||
|
||||
`HybridConnectivityManagementAPI` is the primary interface for developers using the Azure HybridConnectivityManagementApi client library. Explore the methods on this client object to understand the different features of the Azure HybridConnectivityManagementApi 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%2Fhybridconnectivity%2Farm-hybridconnectivity%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": "3e3098d6b9302e166b611ce72b3392786d3ea0f7",
|
||||
"readme": "specification/hybridconnectivity/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\hybridconnectivity\\resource-manager\\readme.md --use=@autorest/typescript@6.0.8 --generate-sample=true",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.2",
|
||||
"use": "@autorest/typescript@6.0.8"
|
||||
}
|
|
@ -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-hybridconnectivity.d.ts"
|
||||
},
|
||||
"messages": {
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
"extractorMessageReporting": {
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
"ae-unresolved-link": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"AssetsRepo": "Azure/azure-sdk-assets",
|
||||
"AssetsRepoPrefixPath": "js",
|
||||
"TagPrefix": "js/hybridconnectivity/arm-hybridconnectivity",
|
||||
"Tag": "js/hybridconnectivity/arm-hybridconnectivity_9b7c026534"
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
{
|
||||
"name": "@azure/arm-hybridconnectivity",
|
||||
"sdk-type": "mgmt",
|
||||
"author": "Microsoft Corporation",
|
||||
"description": "A generated SDK for HybridConnectivityManagementAPI.",
|
||||
"version": "1.0.0-beta.1",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-client": "^1.7.0",
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-rest-pipeline": "^1.12.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-hybridconnectivity.d.ts",
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "^7.31.1",
|
||||
"@rollup/plugin-commonjs": "^24.0.0",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@rollup/plugin-multi-entry": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"mkdirp": "^2.1.2",
|
||||
"rollup": "^2.66.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"typescript": "~5.0.0",
|
||||
"uglify-js": "^3.4.9",
|
||||
"rimraf": "^3.0.0",
|
||||
"dotenv": "^16.0.0",
|
||||
"@azure/identity": "^2.0.1",
|
||||
"@azure-tools/test-recorder": "^3.0.0",
|
||||
"@azure-tools/test-credential": "^1.0.0",
|
||||
"mocha": "^7.1.1",
|
||||
"@types/chai": "^4.2.8",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"@types/node": "^14.0.0",
|
||||
"ts-node": "^10.0.0",
|
||||
"@azure/dev-tool": "^1.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*.js",
|
||||
"dist/**/*.js.map",
|
||||
"dist/**/*.d.ts",
|
||||
"dist/**/*.d.ts.map",
|
||||
"dist-esm/**/*.js",
|
||||
"dist-esm/**/*.js.map",
|
||||
"dist-esm/**/*.d.ts",
|
||||
"dist-esm/**/*.d.ts.map",
|
||||
"src/**/*.ts",
|
||||
"README.md",
|
||||
"LICENSE",
|
||||
"rollup.config.js",
|
||||
"tsconfig.json",
|
||||
"review/*",
|
||||
"CHANGELOG.md",
|
||||
"types/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
||||
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
|
||||
"prepack": "npm run build",
|
||||
"pack": "npm pack 2>&1",
|
||||
"extract-api": "api-extractor run --local",
|
||||
"lint": "echo skipped",
|
||||
"audit": "echo skipped",
|
||||
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
||||
"build:node": "echo skipped",
|
||||
"build:browser": "echo skipped",
|
||||
"build:test": "echo skipped",
|
||||
"build:samples": "echo skipped.",
|
||||
"check-format": "echo skipped",
|
||||
"execute:samples": "echo skipped",
|
||||
"format": "echo skipped",
|
||||
"test": "npm run integration-test",
|
||||
"test:node": "echo skipped",
|
||||
"test:browser": "echo skipped",
|
||||
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
|
||||
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
|
||||
"unit-test:browser": "echo skipped",
|
||||
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
|
||||
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
|
||||
"integration-test:browser": "echo skipped"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"//metadata": {
|
||||
"constantPaths": [
|
||||
{
|
||||
"path": "src/hybridConnectivityManagementAPI.ts",
|
||||
"prefix": "packageDetails"
|
||||
}
|
||||
]
|
||||
},
|
||||
"autoPublish": true,
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridconnectivity/arm-hybridconnectivity",
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
],
|
||||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-hybridconnectivity?view=azure-node-preview"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,388 @@
|
|||
## API Report File for "@azure/arm-hybridconnectivity"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
|
||||
import * as coreAuth from '@azure/core-auth';
|
||||
import * as coreClient from '@azure/core-client';
|
||||
import { PagedAsyncIterableIterator } from '@azure/core-paging';
|
||||
|
||||
// @public
|
||||
export type ActionType = string;
|
||||
|
||||
// @public
|
||||
export type CreatedByType = string;
|
||||
|
||||
// @public
|
||||
export interface EndpointAccessResource {
|
||||
readonly accessKey?: string;
|
||||
expiresOn?: number;
|
||||
hybridConnectionName?: string;
|
||||
namespaceName?: string;
|
||||
namespaceNameSuffix?: string;
|
||||
serviceConfigurationToken?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface EndpointProperties {
|
||||
readonly provisioningState?: string;
|
||||
resourceId?: string;
|
||||
type: Type;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface EndpointResource extends ProxyResource {
|
||||
properties?: EndpointProperties;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Endpoints {
|
||||
createOrUpdate(resourceUri: string, endpointName: string, endpointResource: EndpointResource, options?: EndpointsCreateOrUpdateOptionalParams): Promise<EndpointsCreateOrUpdateResponse>;
|
||||
delete(resourceUri: string, endpointName: string, options?: EndpointsDeleteOptionalParams): Promise<void>;
|
||||
get(resourceUri: string, endpointName: string, options?: EndpointsGetOptionalParams): Promise<EndpointsGetResponse>;
|
||||
list(resourceUri: string, options?: EndpointsListOptionalParams): PagedAsyncIterableIterator<EndpointResource>;
|
||||
listCredentials(resourceUri: string, endpointName: string, options?: EndpointsListCredentialsOptionalParams): Promise<EndpointsListCredentialsResponse>;
|
||||
listIngressGatewayCredentials(resourceUri: string, endpointName: string, options?: EndpointsListIngressGatewayCredentialsOptionalParams): Promise<EndpointsListIngressGatewayCredentialsResponse>;
|
||||
listManagedProxyDetails(resourceUri: string, endpointName: string, managedProxyRequest: ManagedProxyRequest, options?: EndpointsListManagedProxyDetailsOptionalParams): Promise<EndpointsListManagedProxyDetailsResponse>;
|
||||
update(resourceUri: string, endpointName: string, endpointResource: EndpointResource, options?: EndpointsUpdateOptionalParams): Promise<EndpointsUpdateResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface EndpointsCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsCreateOrUpdateResponse = EndpointResource;
|
||||
|
||||
// @public
|
||||
export interface EndpointsDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface EndpointsGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsGetResponse = EndpointResource;
|
||||
|
||||
// @public
|
||||
export interface EndpointsList {
|
||||
nextLink?: string;
|
||||
value?: EndpointResource[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface EndpointsListCredentialsOptionalParams extends coreClient.OperationOptions {
|
||||
expiresin?: number;
|
||||
listCredentialsRequest?: ListCredentialsRequest;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsListCredentialsResponse = EndpointAccessResource;
|
||||
|
||||
// @public
|
||||
export interface EndpointsListIngressGatewayCredentialsOptionalParams extends coreClient.OperationOptions {
|
||||
expiresin?: number;
|
||||
listIngressGatewayCredentialsRequest?: ListIngressGatewayCredentialsRequest;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsListIngressGatewayCredentialsResponse = IngressGatewayResource;
|
||||
|
||||
// @public
|
||||
export interface EndpointsListManagedProxyDetailsOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsListManagedProxyDetailsResponse = ManagedProxyResource;
|
||||
|
||||
// @public
|
||||
export interface EndpointsListNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsListNextResponse = EndpointsList;
|
||||
|
||||
// @public
|
||||
export interface EndpointsListOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsListResponse = EndpointsList;
|
||||
|
||||
// @public
|
||||
export interface EndpointsUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type EndpointsUpdateResponse = EndpointResource;
|
||||
|
||||
// @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 function getContinuationToken(page: unknown): string | undefined;
|
||||
|
||||
// @public (undocumented)
|
||||
export class HybridConnectivityManagementAPI extends coreClient.ServiceClient {
|
||||
// (undocumented)
|
||||
$host: string;
|
||||
constructor(credentials: coreAuth.TokenCredential, options?: HybridConnectivityManagementAPIOptionalParams);
|
||||
// (undocumented)
|
||||
apiVersion: string;
|
||||
// (undocumented)
|
||||
endpoints: Endpoints;
|
||||
// (undocumented)
|
||||
operations: Operations;
|
||||
// (undocumented)
|
||||
serviceConfigurations: ServiceConfigurations;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface HybridConnectivityManagementAPIOptionalParams extends coreClient.ServiceClientOptions {
|
||||
$host?: string;
|
||||
apiVersion?: string;
|
||||
endpoint?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface IngressGatewayResource {
|
||||
readonly accessKey?: string;
|
||||
expiresOn?: number;
|
||||
hostname?: string;
|
||||
hybridConnectionName?: string;
|
||||
namespaceName?: string;
|
||||
namespaceNameSuffix?: string;
|
||||
serverId?: string;
|
||||
serviceConfigurationToken?: string;
|
||||
tenantId?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownActionType {
|
||||
Internal = "Internal"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownCreatedByType {
|
||||
Application = "Application",
|
||||
Key = "Key",
|
||||
ManagedIdentity = "ManagedIdentity",
|
||||
User = "User"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownOrigin {
|
||||
System = "system",
|
||||
User = "user",
|
||||
UserSystem = "user,system"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownProvisioningState {
|
||||
Canceled = "Canceled",
|
||||
Creating = "Creating",
|
||||
Failed = "Failed",
|
||||
Succeeded = "Succeeded",
|
||||
Updating = "Updating"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownServiceName {
|
||||
SSH = "SSH",
|
||||
WAC = "WAC"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownType {
|
||||
Custom = "custom",
|
||||
Default = "default"
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ListCredentialsRequest {
|
||||
serviceName?: ServiceName;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ListIngressGatewayCredentialsRequest {
|
||||
serviceName?: ServiceName;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ManagedProxyRequest {
|
||||
hostname?: string;
|
||||
service: string;
|
||||
serviceName?: ServiceName;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ManagedProxyResource {
|
||||
expiresOn: number;
|
||||
proxy: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Operation {
|
||||
readonly actionType?: ActionType;
|
||||
display?: OperationDisplay;
|
||||
readonly isDataAction?: boolean;
|
||||
readonly name?: string;
|
||||
readonly origin?: Origin;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationDisplay {
|
||||
readonly description?: string;
|
||||
readonly operation?: string;
|
||||
readonly provider?: string;
|
||||
readonly resource?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationListResult {
|
||||
readonly nextLink?: string;
|
||||
readonly value?: Operation[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Operations {
|
||||
list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator<Operation>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface OperationsListNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type OperationsListNextResponse = OperationListResult;
|
||||
|
||||
// @public
|
||||
export interface OperationsListOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type OperationsListResponse = OperationListResult;
|
||||
|
||||
// @public
|
||||
export type Origin = string;
|
||||
|
||||
// @public
|
||||
export type ProvisioningState = string;
|
||||
|
||||
// @public
|
||||
export interface ProxyResource extends Resource {
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Resource {
|
||||
readonly id?: string;
|
||||
readonly name?: string;
|
||||
readonly systemData?: SystemData;
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationList {
|
||||
nextLink?: string;
|
||||
value?: ServiceConfigurationResource[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationResource extends ProxyResource {
|
||||
port?: number;
|
||||
readonly provisioningState?: ProvisioningState;
|
||||
resourceId?: string;
|
||||
serviceName?: ServiceName;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationResourcePatch {
|
||||
port?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurations {
|
||||
createOrupdate(resourceUri: string, endpointName: string, serviceConfigurationName: string, serviceConfigurationResource: ServiceConfigurationResource, options?: ServiceConfigurationsCreateOrupdateOptionalParams): Promise<ServiceConfigurationsCreateOrupdateResponse>;
|
||||
delete(resourceUri: string, endpointName: string, serviceConfigurationName: string, options?: ServiceConfigurationsDeleteOptionalParams): Promise<void>;
|
||||
get(resourceUri: string, endpointName: string, serviceConfigurationName: string, options?: ServiceConfigurationsGetOptionalParams): Promise<ServiceConfigurationsGetResponse>;
|
||||
listByEndpointResource(resourceUri: string, endpointName: string, options?: ServiceConfigurationsListByEndpointResourceOptionalParams): PagedAsyncIterableIterator<ServiceConfigurationResource>;
|
||||
update(resourceUri: string, endpointName: string, serviceConfigurationName: string, serviceConfigurationResource: ServiceConfigurationResourcePatch, options?: ServiceConfigurationsUpdateOptionalParams): Promise<ServiceConfigurationsUpdateResponse>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationsCreateOrupdateOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ServiceConfigurationsCreateOrupdateResponse = ServiceConfigurationResource;
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationsDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationsGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ServiceConfigurationsGetResponse = ServiceConfigurationResource;
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationsListByEndpointResourceNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ServiceConfigurationsListByEndpointResourceNextResponse = ServiceConfigurationList;
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationsListByEndpointResourceOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ServiceConfigurationsListByEndpointResourceResponse = ServiceConfigurationList;
|
||||
|
||||
// @public
|
||||
export interface ServiceConfigurationsUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ServiceConfigurationsUpdateResponse = ServiceConfigurationResource;
|
||||
|
||||
// @public
|
||||
export type ServiceName = string;
|
||||
|
||||
// @public
|
||||
export interface SystemData {
|
||||
createdAt?: Date;
|
||||
createdBy?: string;
|
||||
createdByType?: CreatedByType;
|
||||
lastModifiedAt?: Date;
|
||||
lastModifiedBy?: string;
|
||||
lastModifiedByType?: CreatedByType;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type Type = string;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
```
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import nodeResolve from "@rollup/plugin-node-resolve";
|
||||
import cjs from "@rollup/plugin-commonjs";
|
||||
import sourcemaps from "rollup-plugin-sourcemaps";
|
||||
import multiEntry from "@rollup/plugin-multi-entry";
|
||||
import json from "@rollup/plugin-json";
|
||||
|
||||
import nodeBuiltins from "builtin-modules";
|
||||
|
||||
// #region Warning Handler
|
||||
|
||||
/**
|
||||
* A function that can determine whether a rollup warning should be ignored. If
|
||||
* the function returns `true`, then the warning will not be displayed.
|
||||
*/
|
||||
|
||||
function ignoreNiseSinonEval(warning) {
|
||||
return (
|
||||
warning.code === "EVAL" &&
|
||||
warning.id &&
|
||||
(warning.id.includes("node_modules/nise") ||
|
||||
warning.id.includes("node_modules/sinon")) === true
|
||||
);
|
||||
}
|
||||
|
||||
function ignoreChaiCircularDependency(warning) {
|
||||
return (
|
||||
warning.code === "CIRCULAR_DEPENDENCY" &&
|
||||
warning.importer && warning.importer.includes("node_modules/chai") === true
|
||||
);
|
||||
}
|
||||
|
||||
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
|
||||
|
||||
/**
|
||||
* Construct a warning handler for the shared rollup configuration
|
||||
* that ignores certain warnings that are not relevant to testing.
|
||||
*/
|
||||
function makeOnWarnForTesting() {
|
||||
return (warning, warn) => {
|
||||
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
|
||||
if (warningInhibitors.every((inhib) => !inhib(warning))) {
|
||||
warn(warning);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// #endregion
|
||||
|
||||
function makeBrowserTestConfig() {
|
||||
const config = {
|
||||
input: {
|
||||
include: ["dist-esm/test/**/*.spec.js"],
|
||||
exclude: ["dist-esm/test/**/node/**"]
|
||||
},
|
||||
output: {
|
||||
file: `dist-test/index.browser.js`,
|
||||
format: "umd",
|
||||
sourcemap: true
|
||||
},
|
||||
preserveSymlinks: false,
|
||||
plugins: [
|
||||
multiEntry({ exports: false }),
|
||||
nodeResolve({
|
||||
mainFields: ["module", "browser"]
|
||||
}),
|
||||
cjs(),
|
||||
json(),
|
||||
sourcemaps()
|
||||
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
||||
],
|
||||
onwarn: makeOnWarnForTesting(),
|
||||
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
|
||||
// rollup started respecting the "sideEffects" field in package.json. Since
|
||||
// our package.json sets "sideEffects=false", this also applies to test
|
||||
// code, which causes all tests to be removed by tree-shaking.
|
||||
treeshake: false
|
||||
};
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
const defaultConfigurationOptions = {
|
||||
disableBrowserBundle: false
|
||||
};
|
||||
|
||||
export function makeConfig(pkg, options) {
|
||||
options = {
|
||||
...defaultConfigurationOptions,
|
||||
...(options || {})
|
||||
};
|
||||
|
||||
const baseConfig = {
|
||||
// Use the package's module field if it has one
|
||||
input: pkg["module"] || "dist-esm/src/index.js",
|
||||
external: [
|
||||
...nodeBuiltins,
|
||||
...Object.keys(pkg.dependencies),
|
||||
...Object.keys(pkg.devDependencies)
|
||||
],
|
||||
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
||||
preserveSymlinks: false,
|
||||
plugins: [sourcemaps(), nodeResolve()]
|
||||
};
|
||||
|
||||
const config = [baseConfig];
|
||||
|
||||
if (!options.disableBrowserBundle) {
|
||||
config.push(makeBrowserTestConfig());
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
export default makeConfig(require("./package.json"));
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 {
|
||||
EndpointResource,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Create or update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutCustom.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPutCustom() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "custom";
|
||||
const endpointResource: EndpointResource = {
|
||||
properties: {
|
||||
type: "custom",
|
||||
resourceId:
|
||||
"/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace"
|
||||
}
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.createOrUpdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
endpointResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Create or update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPutDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const endpointResource: EndpointResource = {
|
||||
properties: { type: "default" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.createOrUpdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
endpointResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPutCustom();
|
||||
hybridConnectivityEndpointsPutDefault();
|
||||
}
|
||||
|
||||
main().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 { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the endpoint access to the target resource.
|
||||
*
|
||||
* @summary Deletes the endpoint access to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsDeleteDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsDeleteDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.delete(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsDeleteDefault();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetCustom.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGetCustom() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "custom";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.get(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGetDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.get(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsGetCustom();
|
||||
hybridConnectivityEndpointsGetDefault();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ListCredentialsRequest,
|
||||
EndpointsListCredentialsOptionalParams,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint access credentials to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint access credentials to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListCredentials.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListCredentials() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const expiresin = 10800;
|
||||
const listCredentialsRequest: ListCredentialsRequest = { serviceName: "SSH" };
|
||||
const options: EndpointsListCredentialsOptionalParams = {
|
||||
expiresin,
|
||||
listCredentialsRequest
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listCredentials(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListCredentials();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
EndpointsListIngressGatewayCredentialsOptionalParams,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the ingress gateway endpoint credentials
|
||||
*
|
||||
* @summary Gets the ingress gateway endpoint credentials
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListIngressGatewayCredentials.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListIngressGatewayCredentials() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.ArcPlaceHolder/ProvisionedClusters/cluster0";
|
||||
const endpointName = "default";
|
||||
const expiresin = 10800;
|
||||
const options: EndpointsListIngressGatewayCredentialsOptionalParams = {
|
||||
expiresin
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listIngressGatewayCredentials(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListIngressGatewayCredentials();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ManagedProxyRequest,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Fetches the managed proxy details
|
||||
*
|
||||
* @summary Fetches the managed proxy details
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListManagedProxyDetails.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListManagedProxyDetails() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006";
|
||||
const endpointName = "default";
|
||||
const managedProxyRequest: ManagedProxyRequest = {
|
||||
hostname: "r.proxy.arc.com",
|
||||
service: "127.0.0.1:65035",
|
||||
serviceName: "WAC"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listManagedProxyDetails(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
managedProxyRequest
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListManagedProxyDetails();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List of endpoints to the target resource.
|
||||
*
|
||||
* @summary List of endpoints to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsList.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGet() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.endpoints.list(resourceUri)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
EndpointResource,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPatchDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPatchDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const endpointResource: EndpointResource = {
|
||||
properties: { type: "default" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.update(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
endpointResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPatchDefault();
|
||||
}
|
||||
|
||||
main().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 { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the available Hybrid Connectivity REST API operations.
|
||||
*
|
||||
* @summary Lists the available Hybrid Connectivity REST API operations.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/OperationsList.json
|
||||
*/
|
||||
async function hybridConnectivityOperationsList() {
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityOperationsList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 {
|
||||
ServiceConfigurationResource,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
*
|
||||
* @summary Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsPutSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const serviceConfigurationResource: ServiceConfigurationResource = {
|
||||
port: 22,
|
||||
serviceName: "SSH"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.createOrupdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
*
|
||||
* @summary Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutWAC.json
|
||||
*/
|
||||
async function serviceConfigurationsPutWac() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "WAC";
|
||||
const serviceConfigurationResource: ServiceConfigurationResource = {
|
||||
port: 6516,
|
||||
serviceName: "WAC"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.createOrupdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsPutSsh();
|
||||
serviceConfigurationsPutWac();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the service details to the target resource.
|
||||
*
|
||||
* @summary Deletes the service details to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsDeleteSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsDeleteSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.delete(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsDeleteSsh();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details about the service to the resource.
|
||||
*
|
||||
* @summary Gets the details about the service to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetSSH.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsServiceconfigurationsGetSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.get(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details about the service to the resource.
|
||||
*
|
||||
* @summary Gets the details about the service to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetWAC.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsServiceconfigurationsGetWac() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "WAC";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.get(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsServiceconfigurationsGetSsh();
|
||||
hybridConnectivityEndpointsServiceconfigurationsGetWac();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
*
|
||||
* @summary API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsList.json
|
||||
*/
|
||||
async function getClustersExample() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.serviceConfigurations.listByEndpointResource(
|
||||
resourceUri,
|
||||
endpointName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getClustersExample();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ServiceConfigurationResourcePatch,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the service details in the service configurations of the target resource.
|
||||
*
|
||||
* @summary Update the service details in the service configurations of the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPatchSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsPatchSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const serviceConfigurationResource: ServiceConfigurationResourcePatch = {
|
||||
port: 22
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.update(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsPatchSsh();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,76 @@
|
|||
# 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** |
|
||||
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [endpointsCreateOrUpdateSample.js][endpointscreateorupdatesample] | Create or update the endpoint to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutCustom.json |
|
||||
| [endpointsDeleteSample.js][endpointsdeletesample] | Deletes the endpoint access to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsDeleteDefault.json |
|
||||
| [endpointsGetSample.js][endpointsgetsample] | Gets the endpoint to the resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetCustom.json |
|
||||
| [endpointsListCredentialsSample.js][endpointslistcredentialssample] | Gets the endpoint access credentials to the resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListCredentials.json |
|
||||
| [endpointsListIngressGatewayCredentialsSample.js][endpointslistingressgatewaycredentialssample] | Gets the ingress gateway endpoint credentials x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListIngressGatewayCredentials.json |
|
||||
| [endpointsListManagedProxyDetailsSample.js][endpointslistmanagedproxydetailssample] | Fetches the managed proxy details x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListManagedProxyDetails.json |
|
||||
| [endpointsListSample.js][endpointslistsample] | List of endpoints to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsList.json |
|
||||
| [endpointsUpdateSample.js][endpointsupdatesample] | Update the endpoint to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPatchDefault.json |
|
||||
| [operationsListSample.js][operationslistsample] | Lists the available Hybrid Connectivity REST API operations. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/OperationsList.json |
|
||||
| [serviceConfigurationsCreateOrupdateSample.js][serviceconfigurationscreateorupdatesample] | Create or update a service in serviceConfiguration for the endpoint resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutSSH.json |
|
||||
| [serviceConfigurationsDeleteSample.js][serviceconfigurationsdeletesample] | Deletes the service details to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsDeleteSSH.json |
|
||||
| [serviceConfigurationsGetSample.js][serviceconfigurationsgetsample] | Gets the details about the service to the resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetSSH.json |
|
||||
| [serviceConfigurationsListByEndpointResourceSample.js][serviceconfigurationslistbyendpointresourcesample] | API to enumerate registered services in service configurations under a Endpoint Resource x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsList.json |
|
||||
| [serviceConfigurationsUpdateSample.js][serviceconfigurationsupdatesample] | Update the service details in the service configurations of the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPatchSSH.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node endpointsCreateOrUpdateSample.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 endpointsCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[endpointscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsCreateOrUpdateSample.js
|
||||
[endpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsDeleteSample.js
|
||||
[endpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsGetSample.js
|
||||
[endpointslistcredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsListCredentialsSample.js
|
||||
[endpointslistingressgatewaycredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsListIngressGatewayCredentialsSample.js
|
||||
[endpointslistmanagedproxydetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsListManagedProxyDetailsSample.js
|
||||
[endpointslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsListSample.js
|
||||
[endpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/endpointsUpdateSample.js
|
||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/operationsListSample.js
|
||||
[serviceconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/serviceConfigurationsCreateOrupdateSample.js
|
||||
[serviceconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/serviceConfigurationsDeleteSample.js
|
||||
[serviceconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/serviceConfigurationsGetSample.js
|
||||
[serviceconfigurationslistbyendpointresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/serviceConfigurationsListByEndpointResourceSample.js
|
||||
[serviceconfigurationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/javascript/serviceConfigurationsUpdateSample.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-hybridconnectivity?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridconnectivity/arm-hybridconnectivity/README.md
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Create or update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutCustom.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPutCustom() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "custom";
|
||||
const endpointResource = {
|
||||
properties: {
|
||||
type: "custom",
|
||||
resourceId:
|
||||
"/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace",
|
||||
},
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.createOrUpdate(resourceUri, endpointName, endpointResource);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Create or update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPutDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const endpointResource = {
|
||||
properties: { type: "default" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.createOrUpdate(resourceUri, endpointName, endpointResource);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPutCustom();
|
||||
hybridConnectivityEndpointsPutDefault();
|
||||
}
|
||||
|
||||
main().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 { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the endpoint access to the target resource.
|
||||
*
|
||||
* @summary Deletes the endpoint access to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsDeleteDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsDeleteDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.delete(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsDeleteDefault();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetCustom.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGetCustom() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "custom";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.get(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGetDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.get(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsGetCustom();
|
||||
hybridConnectivityEndpointsGetDefault();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint access credentials to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint access credentials to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListCredentials.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListCredentials() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const expiresin = 10800;
|
||||
const listCredentialsRequest = { serviceName: "SSH" };
|
||||
const options = {
|
||||
expiresin,
|
||||
listCredentialsRequest,
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listCredentials(resourceUri, endpointName, options);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListCredentials();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the ingress gateway endpoint credentials
|
||||
*
|
||||
* @summary Gets the ingress gateway endpoint credentials
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListIngressGatewayCredentials.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListIngressGatewayCredentials() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.ArcPlaceHolder/ProvisionedClusters/cluster0";
|
||||
const endpointName = "default";
|
||||
const expiresin = 10800;
|
||||
const options = {
|
||||
expiresin,
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listIngressGatewayCredentials(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListIngressGatewayCredentials();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Fetches the managed proxy details
|
||||
*
|
||||
* @summary Fetches the managed proxy details
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListManagedProxyDetails.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListManagedProxyDetails() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006";
|
||||
const endpointName = "default";
|
||||
const managedProxyRequest = {
|
||||
hostname: "r.proxy.arc.com",
|
||||
service: "127.0.0.1:65035",
|
||||
serviceName: "WAC",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listManagedProxyDetails(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
managedProxyRequest
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListManagedProxyDetails();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List of endpoints to the target resource.
|
||||
*
|
||||
* @summary List of endpoints to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsList.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGet() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.endpoints.list(resourceUri)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPatchDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPatchDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const endpointResource = {
|
||||
properties: { type: "default" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.update(resourceUri, endpointName, endpointResource);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPatchDefault();
|
||||
}
|
||||
|
||||
main().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 { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the available Hybrid Connectivity REST API operations.
|
||||
*
|
||||
* @summary Lists the available Hybrid Connectivity REST API operations.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/OperationsList.json
|
||||
*/
|
||||
async function hybridConnectivityOperationsList() {
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityOperationsList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-hybridconnectivity-js-beta",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for JavaScript (Beta)",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/hybridconnectivity/arm-hybridconnectivity"
|
||||
},
|
||||
"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/hybridconnectivity/arm-hybridconnectivity",
|
||||
"dependencies": {
|
||||
"@azure/arm-hybridconnectivity": "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,72 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
*
|
||||
* @summary Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsPutSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const serviceConfigurationResource = {
|
||||
port: 22,
|
||||
serviceName: "SSH",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.createOrupdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
*
|
||||
* @summary Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutWAC.json
|
||||
*/
|
||||
async function serviceConfigurationsPutWac() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "WAC";
|
||||
const serviceConfigurationResource = {
|
||||
port: 6516,
|
||||
serviceName: "WAC",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.createOrupdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsPutSsh();
|
||||
serviceConfigurationsPutWac();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the service details to the target resource.
|
||||
*
|
||||
* @summary Deletes the service details to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsDeleteSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsDeleteSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.delete(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsDeleteSsh();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details about the service to the resource.
|
||||
*
|
||||
* @summary Gets the details about the service to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetSSH.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsServiceconfigurationsGetSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.get(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details about the service to the resource.
|
||||
*
|
||||
* @summary Gets the details about the service to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetWAC.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsServiceconfigurationsGetWac() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "WAC";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.get(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsServiceconfigurationsGetSsh();
|
||||
hybridConnectivityEndpointsServiceconfigurationsGetWac();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
*
|
||||
* @summary API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsList.json
|
||||
*/
|
||||
async function getClustersExample() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.serviceConfigurations.listByEndpointResource(
|
||||
resourceUri,
|
||||
endpointName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getClustersExample();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { HybridConnectivityManagementAPI } = require("@azure/arm-hybridconnectivity");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
require("dotenv").config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the service details in the service configurations of the target resource.
|
||||
*
|
||||
* @summary Update the service details in the service configurations of the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPatchSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsPatchSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const serviceConfigurationResource = {
|
||||
port: 22,
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.update(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsPatchSsh();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,89 @@
|
|||
# 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** |
|
||||
| --------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [endpointsCreateOrUpdateSample.ts][endpointscreateorupdatesample] | Create or update the endpoint to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutCustom.json |
|
||||
| [endpointsDeleteSample.ts][endpointsdeletesample] | Deletes the endpoint access to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsDeleteDefault.json |
|
||||
| [endpointsGetSample.ts][endpointsgetsample] | Gets the endpoint to the resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetCustom.json |
|
||||
| [endpointsListCredentialsSample.ts][endpointslistcredentialssample] | Gets the endpoint access credentials to the resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListCredentials.json |
|
||||
| [endpointsListIngressGatewayCredentialsSample.ts][endpointslistingressgatewaycredentialssample] | Gets the ingress gateway endpoint credentials x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListIngressGatewayCredentials.json |
|
||||
| [endpointsListManagedProxyDetailsSample.ts][endpointslistmanagedproxydetailssample] | Fetches the managed proxy details x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListManagedProxyDetails.json |
|
||||
| [endpointsListSample.ts][endpointslistsample] | List of endpoints to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsList.json |
|
||||
| [endpointsUpdateSample.ts][endpointsupdatesample] | Update the endpoint to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPatchDefault.json |
|
||||
| [operationsListSample.ts][operationslistsample] | Lists the available Hybrid Connectivity REST API operations. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/OperationsList.json |
|
||||
| [serviceConfigurationsCreateOrupdateSample.ts][serviceconfigurationscreateorupdatesample] | Create or update a service in serviceConfiguration for the endpoint resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutSSH.json |
|
||||
| [serviceConfigurationsDeleteSample.ts][serviceconfigurationsdeletesample] | Deletes the service details to the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsDeleteSSH.json |
|
||||
| [serviceConfigurationsGetSample.ts][serviceconfigurationsgetsample] | Gets the details about the service to the resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetSSH.json |
|
||||
| [serviceConfigurationsListByEndpointResourceSample.ts][serviceconfigurationslistbyendpointresourcesample] | API to enumerate registered services in service configurations under a Endpoint Resource x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsList.json |
|
||||
| [serviceConfigurationsUpdateSample.ts][serviceconfigurationsupdatesample] | Update the service details in the service configurations of the target resource. x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPatchSSH.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
|
||||
|
||||
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
|
||||
|
||||
```bash
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Compile the samples:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dist/endpointsCreateOrUpdateSample.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/endpointsCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[endpointscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsCreateOrUpdateSample.ts
|
||||
[endpointsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsDeleteSample.ts
|
||||
[endpointsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsGetSample.ts
|
||||
[endpointslistcredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsListCredentialsSample.ts
|
||||
[endpointslistingressgatewaycredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsListIngressGatewayCredentialsSample.ts
|
||||
[endpointslistmanagedproxydetailssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsListManagedProxyDetailsSample.ts
|
||||
[endpointslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsListSample.ts
|
||||
[endpointsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/endpointsUpdateSample.ts
|
||||
[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/operationsListSample.ts
|
||||
[serviceconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/serviceConfigurationsCreateOrupdateSample.ts
|
||||
[serviceconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/serviceConfigurationsDeleteSample.ts
|
||||
[serviceconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/serviceConfigurationsGetSample.ts
|
||||
[serviceconfigurationslistbyendpointresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/serviceConfigurationsListByEndpointResourceSample.ts
|
||||
[serviceconfigurationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/hybridconnectivity/arm-hybridconnectivity/samples/v1-beta/typescript/src/serviceConfigurationsUpdateSample.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-hybridconnectivity?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridconnectivity/arm-hybridconnectivity/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-hybridconnectivity-ts-beta",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for TypeScript (Beta)",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prebuild": "rimraf dist/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/hybridconnectivity/arm-hybridconnectivity"
|
||||
},
|
||||
"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/hybridconnectivity/arm-hybridconnectivity",
|
||||
"dependencies": {
|
||||
"@azure/arm-hybridconnectivity": "next",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.0.0",
|
||||
"typescript": "~5.0.0",
|
||||
"rimraf": "latest"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 {
|
||||
EndpointResource,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Create or update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutCustom.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPutCustom() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "custom";
|
||||
const endpointResource: EndpointResource = {
|
||||
properties: {
|
||||
type: "custom",
|
||||
resourceId:
|
||||
"/subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.Relay/namespaces/custom-relay-namespace"
|
||||
}
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.createOrUpdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
endpointResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Create or update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPutDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPutDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const endpointResource: EndpointResource = {
|
||||
properties: { type: "default" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.createOrUpdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
endpointResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPutCustom();
|
||||
hybridConnectivityEndpointsPutDefault();
|
||||
}
|
||||
|
||||
main().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 { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the endpoint access to the target resource.
|
||||
*
|
||||
* @summary Deletes the endpoint access to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsDeleteDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsDeleteDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.delete(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsDeleteDefault();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetCustom.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGetCustom() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "custom";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.get(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsGetDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGetDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.get(resourceUri, endpointName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsGetCustom();
|
||||
hybridConnectivityEndpointsGetDefault();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ListCredentialsRequest,
|
||||
EndpointsListCredentialsOptionalParams,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the endpoint access credentials to the resource.
|
||||
*
|
||||
* @summary Gets the endpoint access credentials to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListCredentials.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListCredentials() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const expiresin = 10800;
|
||||
const listCredentialsRequest: ListCredentialsRequest = { serviceName: "SSH" };
|
||||
const options: EndpointsListCredentialsOptionalParams = {
|
||||
expiresin,
|
||||
listCredentialsRequest
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listCredentials(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListCredentials();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
EndpointsListIngressGatewayCredentialsOptionalParams,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the ingress gateway endpoint credentials
|
||||
*
|
||||
* @summary Gets the ingress gateway endpoint credentials
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListIngressGatewayCredentials.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListIngressGatewayCredentials() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.ArcPlaceHolder/ProvisionedClusters/cluster0";
|
||||
const endpointName = "default";
|
||||
const expiresin = 10800;
|
||||
const options: EndpointsListIngressGatewayCredentialsOptionalParams = {
|
||||
expiresin
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listIngressGatewayCredentials(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListIngressGatewayCredentials();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ManagedProxyRequest,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Fetches the managed proxy details
|
||||
*
|
||||
* @summary Fetches the managed proxy details
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPostListManagedProxyDetails.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPostListManagedProxyDetails() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/arcGroup/providers/Microsoft.Compute/virtualMachines/vm00006";
|
||||
const endpointName = "default";
|
||||
const managedProxyRequest: ManagedProxyRequest = {
|
||||
hostname: "r.proxy.arc.com",
|
||||
service: "127.0.0.1:65035",
|
||||
serviceName: "WAC"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.listManagedProxyDetails(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
managedProxyRequest
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPostListManagedProxyDetails();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to List of endpoints to the target resource.
|
||||
*
|
||||
* @summary List of endpoints to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsList.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsGet() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.endpoints.list(resourceUri)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsGet();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
EndpointResource,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the endpoint to the target resource.
|
||||
*
|
||||
* @summary Update the endpoint to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/EndpointsPatchDefault.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsPatchDefault() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine";
|
||||
const endpointName = "default";
|
||||
const endpointResource: EndpointResource = {
|
||||
properties: { type: "default" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.endpoints.update(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
endpointResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsPatchDefault();
|
||||
}
|
||||
|
||||
main().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 { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists the available Hybrid Connectivity REST API operations.
|
||||
*
|
||||
* @summary Lists the available Hybrid Connectivity REST API operations.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/OperationsList.json
|
||||
*/
|
||||
async function hybridConnectivityOperationsList() {
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.operations.list()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityOperationsList();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code 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 {
|
||||
ServiceConfigurationResource,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
*
|
||||
* @summary Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsPutSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const serviceConfigurationResource: ServiceConfigurationResource = {
|
||||
port: 22,
|
||||
serviceName: "SSH"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.createOrupdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
*
|
||||
* @summary Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPutWAC.json
|
||||
*/
|
||||
async function serviceConfigurationsPutWac() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "WAC";
|
||||
const serviceConfigurationResource: ServiceConfigurationResource = {
|
||||
port: 6516,
|
||||
serviceName: "WAC"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.createOrupdate(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsPutSsh();
|
||||
serviceConfigurationsPutWac();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the service details to the target resource.
|
||||
*
|
||||
* @summary Deletes the service details to the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsDeleteSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsDeleteSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.delete(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsDeleteSsh();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details about the service to the resource.
|
||||
*
|
||||
* @summary Gets the details about the service to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetSSH.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsServiceconfigurationsGetSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.get(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details about the service to the resource.
|
||||
*
|
||||
* @summary Gets the details about the service to the resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsGetWAC.json
|
||||
*/
|
||||
async function hybridConnectivityEndpointsServiceconfigurationsGetWac() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "WAC";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.get(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
hybridConnectivityEndpointsServiceconfigurationsGetSsh();
|
||||
hybridConnectivityEndpointsServiceconfigurationsGetWac();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { HybridConnectivityManagementAPI } from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
*
|
||||
* @summary API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsList.json
|
||||
*/
|
||||
async function getClustersExample() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.serviceConfigurations.listByEndpointResource(
|
||||
resourceUri,
|
||||
endpointName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
getClustersExample();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ServiceConfigurationResourcePatch,
|
||||
HybridConnectivityManagementAPI
|
||||
} from "@azure/arm-hybridconnectivity";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
import * as dotenv from "dotenv";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Update the service details in the service configurations of the target resource.
|
||||
*
|
||||
* @summary Update the service details in the service configurations of the target resource.
|
||||
* x-ms-original-file: specification/hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2023-03-15/examples/ServiceConfigurationsPatchSSH.json
|
||||
*/
|
||||
async function serviceConfigurationsPatchSsh() {
|
||||
const resourceUri =
|
||||
"subscriptions/f5bcc1d9-23af-4ae9-aca1-041d0f593a63/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/machines/testMachine/providers/Microsoft.HybridConnectivity/endpoints/default";
|
||||
const endpointName = "default";
|
||||
const serviceConfigurationName = "SSH";
|
||||
const serviceConfigurationResource: ServiceConfigurationResourcePatch = {
|
||||
port: 22
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new HybridConnectivityManagementAPI(credential);
|
||||
const result = await client.serviceConfigurations.update(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
async function main() {
|
||||
serviceConfigurationsPatchSsh();
|
||||
}
|
||||
|
||||
main().catch(console.error);
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": [
|
||||
"src/**.ts"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 {
|
||||
OperationsImpl,
|
||||
EndpointsImpl,
|
||||
ServiceConfigurationsImpl
|
||||
} from "./operations";
|
||||
import {
|
||||
Operations,
|
||||
Endpoints,
|
||||
ServiceConfigurations
|
||||
} from "./operationsInterfaces";
|
||||
import { HybridConnectivityManagementAPIOptionalParams } from "./models";
|
||||
|
||||
export class HybridConnectivityManagementAPI extends coreClient.ServiceClient {
|
||||
$host: string;
|
||||
apiVersion: string;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the HybridConnectivityManagementAPI class.
|
||||
* @param credentials Subscription credentials which uniquely identify client subscription.
|
||||
* @param options The parameter options
|
||||
*/
|
||||
constructor(
|
||||
credentials: coreAuth.TokenCredential,
|
||||
options?: HybridConnectivityManagementAPIOptionalParams
|
||||
) {
|
||||
if (credentials === undefined) {
|
||||
throw new Error("'credentials' cannot be null");
|
||||
}
|
||||
|
||||
// Initializing default values for options
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
const defaults: HybridConnectivityManagementAPIOptionalParams = {
|
||||
requestContentType: "application/json; charset=utf-8",
|
||||
credential: credentials
|
||||
};
|
||||
|
||||
const packageDetails = `azsdk-js-arm-hybridconnectivity/1.0.0-beta.1`;
|
||||
const userAgentPrefix =
|
||||
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
||||
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
||||
: `${packageDetails}`;
|
||||
|
||||
const optionsWithDefaults = {
|
||||
...defaults,
|
||||
...options,
|
||||
userAgentOptions: {
|
||||
userAgentPrefix
|
||||
},
|
||||
endpoint:
|
||||
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
||||
};
|
||||
super(optionsWithDefaults);
|
||||
|
||||
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
||||
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
||||
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
||||
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
||||
(pipelinePolicy) =>
|
||||
pipelinePolicy.name ===
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
);
|
||||
}
|
||||
if (
|
||||
!options ||
|
||||
!options.pipeline ||
|
||||
options.pipeline.getOrderedPolicies().length == 0 ||
|
||||
!bearerTokenAuthenticationPolicyFound
|
||||
) {
|
||||
this.pipeline.removePolicy({
|
||||
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
});
|
||||
this.pipeline.addPolicy(
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
||||
credential: credentials,
|
||||
scopes:
|
||||
optionsWithDefaults.credentialScopes ??
|
||||
`${optionsWithDefaults.endpoint}/.default`,
|
||||
challengeCallbacks: {
|
||||
authorizeRequestOnChallenge:
|
||||
coreClient.authorizeRequestOnClaimChallenge
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
// Assigning values to Constant parameters
|
||||
this.$host = options.$host || "https://management.azure.com";
|
||||
this.apiVersion = options.apiVersion || "2023-03-15";
|
||||
this.operations = new OperationsImpl(this);
|
||||
this.endpoints = new EndpointsImpl(this);
|
||||
this.serviceConfigurations = new ServiceConfigurationsImpl(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);
|
||||
}
|
||||
|
||||
operations: Operations;
|
||||
endpoints: Endpoints;
|
||||
serviceConfigurations: ServiceConfigurations;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
export { getContinuationToken } from "./pagingHelper";
|
||||
export * from "./models";
|
||||
export { HybridConnectivityManagementAPI } from "./hybridConnectivityManagementAPI";
|
||||
export * from "./operationsInterfaces";
|
|
@ -0,0 +1,552 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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";
|
||||
|
||||
/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */
|
||||
export interface OperationListResult {
|
||||
/**
|
||||
* List of operations supported by the resource provider
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly value?: Operation[];
|
||||
/**
|
||||
* URL to get the next set of operation list results (if there are any).
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly nextLink?: string;
|
||||
}
|
||||
|
||||
/** Details of a REST API operation, returned from the Resource Provider Operations API */
|
||||
export interface Operation {
|
||||
/**
|
||||
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/**
|
||||
* Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly isDataAction?: boolean;
|
||||
/** Localized display information for this particular operation. */
|
||||
display?: OperationDisplay;
|
||||
/**
|
||||
* The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly origin?: Origin;
|
||||
/**
|
||||
* Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly actionType?: ActionType;
|
||||
}
|
||||
|
||||
/** Localized display information for this particular operation. */
|
||||
export interface OperationDisplay {
|
||||
/**
|
||||
* The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provider?: string;
|
||||
/**
|
||||
* The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly resource?: string;
|
||||
/**
|
||||
* The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly operation?: string;
|
||||
/**
|
||||
* The short, localized friendly description of the operation; suitable for tool tips and detailed views.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly description?: 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 of endpoints. */
|
||||
export interface EndpointsList {
|
||||
/** The link used to get the next page of endpoints list. */
|
||||
nextLink?: string;
|
||||
/** The list of endpoint. */
|
||||
value?: EndpointResource[];
|
||||
}
|
||||
|
||||
/** Endpoint details */
|
||||
export interface EndpointProperties {
|
||||
/** The type of endpoint. */
|
||||
type: Type;
|
||||
/** The resource Id of the connectivity endpoint (optional). */
|
||||
resourceId?: string;
|
||||
/**
|
||||
* The resource provisioning state.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provisioningState?: string;
|
||||
}
|
||||
|
||||
/** Common fields that are returned in the response for all Azure Resource Manager resources */
|
||||
export interface Resource {
|
||||
/**
|
||||
* Fully qualified resource ID for the resource. E.g. "/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;
|
||||
/**
|
||||
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
}
|
||||
|
||||
/** 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;
|
||||
}
|
||||
|
||||
/** The paginated list of serviceConfigurations */
|
||||
export interface ServiceConfigurationList {
|
||||
/** The list of service configuration */
|
||||
value?: ServiceConfigurationResource[];
|
||||
/** The link to fetch the next page of connected cluster */
|
||||
nextLink?: string;
|
||||
}
|
||||
|
||||
/** The service details under service configuration for the target endpoint resource. */
|
||||
export interface ServiceConfigurationResourcePatch {
|
||||
/** The port on which service is enabled. */
|
||||
port?: number;
|
||||
}
|
||||
|
||||
/** The details of the service for which credentials needs to be returned. */
|
||||
export interface ListCredentialsRequest {
|
||||
/** The name of the service. If not provided, the request will by pass the generation of service configuration token */
|
||||
serviceName?: ServiceName;
|
||||
}
|
||||
|
||||
/** The endpoint access for the target resource. */
|
||||
export interface EndpointAccessResource {
|
||||
/** The namespace name. */
|
||||
namespaceName?: string;
|
||||
/** The suffix domain name of relay namespace. */
|
||||
namespaceNameSuffix?: string;
|
||||
/** Azure Relay hybrid connection name for the resource. */
|
||||
hybridConnectionName?: string;
|
||||
/**
|
||||
* Access key for hybrid connection.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly accessKey?: string;
|
||||
/** The expiration of access key in unix time. */
|
||||
expiresOn?: number;
|
||||
/** The token to access the enabled service. */
|
||||
serviceConfigurationToken?: string;
|
||||
}
|
||||
|
||||
/** Represent ListIngressGatewayCredentials Request object. */
|
||||
export interface ListIngressGatewayCredentialsRequest {
|
||||
/** The name of the service. */
|
||||
serviceName?: ServiceName;
|
||||
}
|
||||
|
||||
/** The ingress gateway access credentials */
|
||||
export interface IngressGatewayResource {
|
||||
/** The ingress hostname. */
|
||||
hostname?: string;
|
||||
/** The arc ingress gateway server app id. */
|
||||
serverId?: string;
|
||||
/** The target resource home tenant id. */
|
||||
tenantId?: string;
|
||||
/** The namespace name. */
|
||||
namespaceName?: string;
|
||||
/** The suffix domain name of relay namespace. */
|
||||
namespaceNameSuffix?: string;
|
||||
/** Azure Relay hybrid connection name for the resource. */
|
||||
hybridConnectionName?: string;
|
||||
/**
|
||||
* Access key for hybrid connection.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly accessKey?: string;
|
||||
/** The expiration of access key in unix time. */
|
||||
expiresOn?: number;
|
||||
/** The token to access the enabled service. */
|
||||
serviceConfigurationToken?: string;
|
||||
}
|
||||
|
||||
/** Represent ManageProxy Request object. */
|
||||
export interface ManagedProxyRequest {
|
||||
/** The name of the service. */
|
||||
service: string;
|
||||
/** The target host name. */
|
||||
hostname?: string;
|
||||
/** The name of the service. It is an optional property, if not provided, service configuration tokens issue code would be by passed. */
|
||||
serviceName?: ServiceName;
|
||||
}
|
||||
|
||||
/** Managed Proxy */
|
||||
export interface ManagedProxyResource {
|
||||
/** The short lived proxy name. */
|
||||
proxy: string;
|
||||
/** The expiration time of short lived proxy name in unix epoch. */
|
||||
expiresOn: number;
|
||||
}
|
||||
|
||||
/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */
|
||||
export interface ProxyResource extends Resource {}
|
||||
|
||||
/** The endpoint for the target resource. */
|
||||
export interface EndpointResource extends ProxyResource {
|
||||
/** The endpoint properties. */
|
||||
properties?: EndpointProperties;
|
||||
}
|
||||
|
||||
/** The service configuration details associated with the target resource. */
|
||||
export interface ServiceConfigurationResource extends ProxyResource {
|
||||
/** Name of the service. */
|
||||
serviceName?: ServiceName;
|
||||
/** The resource Id of the connectivity endpoint (optional). */
|
||||
resourceId?: string;
|
||||
/** The port on which service is enabled. */
|
||||
port?: number;
|
||||
/**
|
||||
* The resource provisioning state.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provisioningState?: ProvisioningState;
|
||||
}
|
||||
|
||||
/** Known values of {@link Origin} that the service accepts. */
|
||||
export enum KnownOrigin {
|
||||
/** User */
|
||||
User = "user",
|
||||
/** System */
|
||||
System = "system",
|
||||
/** UserSystem */
|
||||
UserSystem = "user,system"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for Origin. \
|
||||
* {@link KnownOrigin} can be used interchangeably with Origin,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **user** \
|
||||
* **system** \
|
||||
* **user,system**
|
||||
*/
|
||||
export type Origin = string;
|
||||
|
||||
/** Known values of {@link ActionType} that the service accepts. */
|
||||
export enum KnownActionType {
|
||||
/** Internal */
|
||||
Internal = "Internal"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for ActionType. \
|
||||
* {@link KnownActionType} can be used interchangeably with ActionType,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **Internal**
|
||||
*/
|
||||
export type ActionType = string;
|
||||
|
||||
/** Known values of {@link Type} that the service accepts. */
|
||||
export enum KnownType {
|
||||
/** Default */
|
||||
Default = "default",
|
||||
/** Custom */
|
||||
Custom = "custom"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for Type. \
|
||||
* {@link KnownType} can be used interchangeably with Type,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **default** \
|
||||
* **custom**
|
||||
*/
|
||||
export type Type = 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 ServiceName} that the service accepts. */
|
||||
export enum KnownServiceName {
|
||||
/** SSH */
|
||||
SSH = "SSH",
|
||||
/** WAC */
|
||||
WAC = "WAC"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for ServiceName. \
|
||||
* {@link KnownServiceName} can be used interchangeably with ServiceName,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **SSH** \
|
||||
* **WAC**
|
||||
*/
|
||||
export type ServiceName = string;
|
||||
|
||||
/** Known values of {@link ProvisioningState} that the service accepts. */
|
||||
export enum KnownProvisioningState {
|
||||
/** Succeeded */
|
||||
Succeeded = "Succeeded",
|
||||
/** Creating */
|
||||
Creating = "Creating",
|
||||
/** Updating */
|
||||
Updating = "Updating",
|
||||
/** Failed */
|
||||
Failed = "Failed",
|
||||
/** Canceled */
|
||||
Canceled = "Canceled"
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines values for ProvisioningState. \
|
||||
* {@link KnownProvisioningState} can be used interchangeably with ProvisioningState,
|
||||
* this enum contains the known values that the service supports.
|
||||
* ### Known values supported by the service
|
||||
* **Succeeded** \
|
||||
* **Creating** \
|
||||
* **Updating** \
|
||||
* **Failed** \
|
||||
* **Canceled**
|
||||
*/
|
||||
export type ProvisioningState = string;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface OperationsListOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the list operation. */
|
||||
export type OperationsListResponse = OperationListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface OperationsListNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listNext operation. */
|
||||
export type OperationsListNextResponse = OperationListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsListOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the list operation. */
|
||||
export type EndpointsListResponse = EndpointsList;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type EndpointsGetResponse = EndpointResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsCreateOrUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the createOrUpdate operation. */
|
||||
export type EndpointsCreateOrUpdateResponse = EndpointResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the update operation. */
|
||||
export type EndpointsUpdateResponse = EndpointResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsDeleteOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsListCredentialsOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** Object of type ListCredentialsRequest */
|
||||
listCredentialsRequest?: ListCredentialsRequest;
|
||||
/** The is how long the endpoint access token is valid (in seconds). */
|
||||
expiresin?: number;
|
||||
}
|
||||
|
||||
/** Contains response data for the listCredentials operation. */
|
||||
export type EndpointsListCredentialsResponse = EndpointAccessResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsListIngressGatewayCredentialsOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** The is how long the endpoint access token is valid (in seconds). */
|
||||
expiresin?: number;
|
||||
/** Object of type ListIngressGatewayCredentialsRequest */
|
||||
listIngressGatewayCredentialsRequest?: ListIngressGatewayCredentialsRequest;
|
||||
}
|
||||
|
||||
/** Contains response data for the listIngressGatewayCredentials operation. */
|
||||
export type EndpointsListIngressGatewayCredentialsResponse = IngressGatewayResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsListManagedProxyDetailsOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listManagedProxyDetails operation. */
|
||||
export type EndpointsListManagedProxyDetailsResponse = ManagedProxyResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface EndpointsListNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listNext operation. */
|
||||
export type EndpointsListNextResponse = EndpointsList;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ServiceConfigurationsListByEndpointResourceOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByEndpointResource operation. */
|
||||
export type ServiceConfigurationsListByEndpointResourceResponse = ServiceConfigurationList;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ServiceConfigurationsGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type ServiceConfigurationsGetResponse = ServiceConfigurationResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ServiceConfigurationsCreateOrupdateOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the createOrupdate operation. */
|
||||
export type ServiceConfigurationsCreateOrupdateResponse = ServiceConfigurationResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ServiceConfigurationsUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the update operation. */
|
||||
export type ServiceConfigurationsUpdateResponse = ServiceConfigurationResource;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ServiceConfigurationsDeleteOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ServiceConfigurationsListByEndpointResourceNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByEndpointResourceNext operation. */
|
||||
export type ServiceConfigurationsListByEndpointResourceNextResponse = ServiceConfigurationList;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface HybridConnectivityManagementAPIOptionalParams
|
||||
extends coreClient.ServiceClientOptions {
|
||||
/** server parameter */
|
||||
$host?: string;
|
||||
/** Api Version */
|
||||
apiVersion?: string;
|
||||
/** Overrides client endpoint. */
|
||||
endpoint?: string;
|
||||
}
|
|
@ -0,0 +1,664 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 OperationListResult: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationListResult",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Operation"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Operation: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Operation",
|
||||
modelProperties: {
|
||||
name: {
|
||||
serializedName: "name",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
isDataAction: {
|
||||
serializedName: "isDataAction",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "Boolean"
|
||||
}
|
||||
},
|
||||
display: {
|
||||
serializedName: "display",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationDisplay"
|
||||
}
|
||||
},
|
||||
origin: {
|
||||
serializedName: "origin",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
actionType: {
|
||||
serializedName: "actionType",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const OperationDisplay: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "OperationDisplay",
|
||||
modelProperties: {
|
||||
provider: {
|
||||
serializedName: "provider",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
resource: {
|
||||
serializedName: "resource",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
operation: {
|
||||
serializedName: "operation",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
description: {
|
||||
serializedName: "description",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const 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 EndpointsList: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "EndpointsList",
|
||||
modelProperties: {
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "EndpointResource"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const EndpointProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "EndpointProperties",
|
||||
modelProperties: {
|
||||
type: {
|
||||
serializedName: "type",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
resourceId: {
|
||||
serializedName: "resourceId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
provisioningState: {
|
||||
serializedName: "provisioningState",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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"
|
||||
}
|
||||
},
|
||||
systemData: {
|
||||
serializedName: "systemData",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "SystemData"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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 ServiceConfigurationList: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ServiceConfigurationList",
|
||||
modelProperties: {
|
||||
value: {
|
||||
serializedName: "value",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ServiceConfigurationResource"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ServiceConfigurationResourcePatch: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ServiceConfigurationResourcePatch",
|
||||
modelProperties: {
|
||||
port: {
|
||||
serializedName: "properties.port",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ListCredentialsRequest: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ListCredentialsRequest",
|
||||
modelProperties: {
|
||||
serviceName: {
|
||||
serializedName: "serviceName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const EndpointAccessResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "EndpointAccessResource",
|
||||
modelProperties: {
|
||||
namespaceName: {
|
||||
constraints: {
|
||||
MaxLength: 200,
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "relay.namespaceName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
namespaceNameSuffix: {
|
||||
constraints: {
|
||||
MaxLength: 100,
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "relay.namespaceNameSuffix",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
hybridConnectionName: {
|
||||
serializedName: "relay.hybridConnectionName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
accessKey: {
|
||||
serializedName: "relay.accessKey",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
expiresOn: {
|
||||
serializedName: "relay.expiresOn",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
},
|
||||
serviceConfigurationToken: {
|
||||
serializedName: "relay.serviceConfigurationToken",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ListIngressGatewayCredentialsRequest: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ListIngressGatewayCredentialsRequest",
|
||||
modelProperties: {
|
||||
serviceName: {
|
||||
serializedName: "serviceName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const IngressGatewayResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "IngressGatewayResource",
|
||||
modelProperties: {
|
||||
hostname: {
|
||||
serializedName: "ingress.hostname",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
serverId: {
|
||||
serializedName: "ingress.aadProfile.serverId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
tenantId: {
|
||||
serializedName: "ingress.aadProfile.tenantId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
namespaceName: {
|
||||
constraints: {
|
||||
MaxLength: 200,
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "relay.namespaceName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
namespaceNameSuffix: {
|
||||
constraints: {
|
||||
MaxLength: 100,
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "relay.namespaceNameSuffix",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
hybridConnectionName: {
|
||||
serializedName: "relay.hybridConnectionName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
accessKey: {
|
||||
serializedName: "relay.accessKey",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
expiresOn: {
|
||||
serializedName: "relay.expiresOn",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
},
|
||||
serviceConfigurationToken: {
|
||||
serializedName: "relay.serviceConfigurationToken",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ManagedProxyRequest: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ManagedProxyRequest",
|
||||
modelProperties: {
|
||||
service: {
|
||||
serializedName: "service",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
hostname: {
|
||||
serializedName: "hostname",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
serviceName: {
|
||||
serializedName: "serviceName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ManagedProxyResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ManagedProxyResource",
|
||||
modelProperties: {
|
||||
proxy: {
|
||||
serializedName: "proxy",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
expiresOn: {
|
||||
serializedName: "expiresOn",
|
||||
required: true,
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ProxyResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ProxyResource",
|
||||
modelProperties: {
|
||||
...Resource.type.modelProperties
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const EndpointResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "EndpointResource",
|
||||
modelProperties: {
|
||||
...ProxyResource.type.modelProperties,
|
||||
properties: {
|
||||
serializedName: "properties",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "EndpointProperties"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ServiceConfigurationResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ServiceConfigurationResource",
|
||||
modelProperties: {
|
||||
...ProxyResource.type.modelProperties,
|
||||
serviceName: {
|
||||
serializedName: "properties.serviceName",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
resourceId: {
|
||||
serializedName: "properties.resourceId",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
port: {
|
||||
serializedName: "properties.port",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
},
|
||||
provisioningState: {
|
||||
serializedName: "properties.provisioningState",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 {
|
||||
EndpointResource as EndpointResourceMapper,
|
||||
ListCredentialsRequest as ListCredentialsRequestMapper,
|
||||
ListIngressGatewayCredentialsRequest as ListIngressGatewayCredentialsRequestMapper,
|
||||
ManagedProxyRequest as ManagedProxyRequestMapper,
|
||||
ServiceConfigurationResource as ServiceConfigurationResourceMapper,
|
||||
ServiceConfigurationResourcePatch as ServiceConfigurationResourcePatchMapper
|
||||
} 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: "2023-03-15",
|
||||
isConstant: true,
|
||||
serializedName: "api-version",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const nextLink: OperationURLParameter = {
|
||||
parameterPath: "nextLink",
|
||||
mapper: {
|
||||
serializedName: "nextLink",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const resourceUri: OperationURLParameter = {
|
||||
parameterPath: "resourceUri",
|
||||
mapper: {
|
||||
serializedName: "resourceUri",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const endpointName: OperationURLParameter = {
|
||||
parameterPath: "endpointName",
|
||||
mapper: {
|
||||
serializedName: "endpointName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const contentType: OperationParameter = {
|
||||
parameterPath: ["options", "contentType"],
|
||||
mapper: {
|
||||
defaultValue: "application/json",
|
||||
isConstant: true,
|
||||
serializedName: "Content-Type",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const endpointResource: OperationParameter = {
|
||||
parameterPath: "endpointResource",
|
||||
mapper: EndpointResourceMapper
|
||||
};
|
||||
|
||||
export const listCredentialsRequest: OperationParameter = {
|
||||
parameterPath: ["options", "listCredentialsRequest"],
|
||||
mapper: ListCredentialsRequestMapper
|
||||
};
|
||||
|
||||
export const expiresin: OperationQueryParameter = {
|
||||
parameterPath: ["options", "expiresin"],
|
||||
mapper: {
|
||||
defaultValue: 10800,
|
||||
constraints: {
|
||||
InclusiveMaximum: 10800,
|
||||
InclusiveMinimum: 600
|
||||
},
|
||||
serializedName: "expiresin",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const listIngressGatewayCredentialsRequest: OperationParameter = {
|
||||
parameterPath: ["options", "listIngressGatewayCredentialsRequest"],
|
||||
mapper: ListIngressGatewayCredentialsRequestMapper
|
||||
};
|
||||
|
||||
export const managedProxyRequest: OperationParameter = {
|
||||
parameterPath: "managedProxyRequest",
|
||||
mapper: ManagedProxyRequestMapper
|
||||
};
|
||||
|
||||
export const serviceConfigurationName: OperationURLParameter = {
|
||||
parameterPath: "serviceConfigurationName",
|
||||
mapper: {
|
||||
serializedName: "serviceConfigurationName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const serviceConfigurationResource: OperationParameter = {
|
||||
parameterPath: "serviceConfigurationResource",
|
||||
mapper: ServiceConfigurationResourceMapper
|
||||
};
|
||||
|
||||
export const serviceConfigurationResource1: OperationParameter = {
|
||||
parameterPath: "serviceConfigurationResource",
|
||||
mapper: ServiceConfigurationResourcePatchMapper
|
||||
};
|
|
@ -0,0 +1,469 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
||||
import { setContinuationToken } from "../pagingHelper";
|
||||
import { Endpoints } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { HybridConnectivityManagementAPI } from "../hybridConnectivityManagementAPI";
|
||||
import {
|
||||
EndpointResource,
|
||||
EndpointsListNextOptionalParams,
|
||||
EndpointsListOptionalParams,
|
||||
EndpointsListResponse,
|
||||
EndpointsGetOptionalParams,
|
||||
EndpointsGetResponse,
|
||||
EndpointsCreateOrUpdateOptionalParams,
|
||||
EndpointsCreateOrUpdateResponse,
|
||||
EndpointsUpdateOptionalParams,
|
||||
EndpointsUpdateResponse,
|
||||
EndpointsDeleteOptionalParams,
|
||||
EndpointsListCredentialsOptionalParams,
|
||||
EndpointsListCredentialsResponse,
|
||||
EndpointsListIngressGatewayCredentialsOptionalParams,
|
||||
EndpointsListIngressGatewayCredentialsResponse,
|
||||
ManagedProxyRequest,
|
||||
EndpointsListManagedProxyDetailsOptionalParams,
|
||||
EndpointsListManagedProxyDetailsResponse,
|
||||
EndpointsListNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing Endpoints operations. */
|
||||
export class EndpointsImpl implements Endpoints {
|
||||
private readonly client: HybridConnectivityManagementAPI;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Endpoints class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: HybridConnectivityManagementAPI) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of endpoints to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
resourceUri: string,
|
||||
options?: EndpointsListOptionalParams
|
||||
): PagedAsyncIterableIterator<EndpointResource> {
|
||||
const iter = this.listPagingAll(resourceUri, options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: (settings?: PageSettings) => {
|
||||
if (settings?.maxPageSize) {
|
||||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listPagingPage(resourceUri, options, settings);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
resourceUri: string,
|
||||
options?: EndpointsListOptionalParams,
|
||||
settings?: PageSettings
|
||||
): AsyncIterableIterator<EndpointResource[]> {
|
||||
let result: EndpointsListResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
if (!continuationToken) {
|
||||
result = await this._list(resourceUri, options);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
while (continuationToken) {
|
||||
result = await this._listNext(resourceUri, continuationToken, options);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
}
|
||||
|
||||
private async *listPagingAll(
|
||||
resourceUri: string,
|
||||
options?: EndpointsListOptionalParams
|
||||
): AsyncIterableIterator<EndpointResource> {
|
||||
for await (const page of this.listPagingPage(resourceUri, options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* List of endpoints to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _list(
|
||||
resourceUri: string,
|
||||
options?: EndpointsListOptionalParams
|
||||
): Promise<EndpointsListResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, options },
|
||||
listOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the endpoint to the resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsGetOptionalParams
|
||||
): Promise<EndpointsGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, options },
|
||||
getOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update the endpoint to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param endpointResource Endpoint details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
createOrUpdate(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
endpointResource: EndpointResource,
|
||||
options?: EndpointsCreateOrUpdateOptionalParams
|
||||
): Promise<EndpointsCreateOrUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, endpointResource, options },
|
||||
createOrUpdateOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the endpoint to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param endpointResource Endpoint details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
update(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
endpointResource: EndpointResource,
|
||||
options?: EndpointsUpdateOptionalParams
|
||||
): Promise<EndpointsUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, endpointResource, options },
|
||||
updateOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the endpoint access to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsDeleteOptionalParams
|
||||
): Promise<void> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the endpoint access credentials to the resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listCredentials(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsListCredentialsOptionalParams
|
||||
): Promise<EndpointsListCredentialsResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, options },
|
||||
listCredentialsOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ingress gateway endpoint credentials
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listIngressGatewayCredentials(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsListIngressGatewayCredentialsOptionalParams
|
||||
): Promise<EndpointsListIngressGatewayCredentialsResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, options },
|
||||
listIngressGatewayCredentialsOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the managed proxy details
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param managedProxyRequest Object of type ManagedProxyRequest
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listManagedProxyDetails(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
managedProxyRequest: ManagedProxyRequest,
|
||||
options?: EndpointsListManagedProxyDetailsOptionalParams
|
||||
): Promise<EndpointsListManagedProxyDetailsResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, managedProxyRequest, options },
|
||||
listManagedProxyDetailsOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListNext
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param nextLink The nextLink from the previous successful call to the List method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listNext(
|
||||
resourceUri: string,
|
||||
nextLink: string,
|
||||
options?: EndpointsListNextOptionalParams
|
||||
): Promise<EndpointsListNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, nextLink, options },
|
||||
listNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.EndpointsList
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [Parameters.$host, Parameters.resourceUri],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.EndpointResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.EndpointResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.endpointResource,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const updateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}",
|
||||
httpMethod: "PATCH",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.EndpointResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.endpointResource,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listCredentialsOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listCredentials",
|
||||
httpMethod: "POST",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.EndpointAccessResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.listCredentialsRequest,
|
||||
queryParameters: [Parameters.apiVersion, Parameters.expiresin],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const listIngressGatewayCredentialsOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listIngressGatewayCredentials",
|
||||
httpMethod: "POST",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.IngressGatewayResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.listIngressGatewayCredentialsRequest,
|
||||
queryParameters: [Parameters.apiVersion, Parameters.expiresin],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const listManagedProxyDetailsOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/listManagedProxyDetails",
|
||||
httpMethod: "POST",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ManagedProxyResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.managedProxyRequest,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const listNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.EndpointsList
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.nextLink,
|
||||
Parameters.resourceUri
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 "./operations";
|
||||
export * from "./endpoints";
|
||||
export * from "./serviceConfigurations";
|
|
@ -0,0 +1,149 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
||||
import { setContinuationToken } from "../pagingHelper";
|
||||
import { Operations } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { HybridConnectivityManagementAPI } from "../hybridConnectivityManagementAPI";
|
||||
import {
|
||||
Operation,
|
||||
OperationsListNextOptionalParams,
|
||||
OperationsListOptionalParams,
|
||||
OperationsListResponse,
|
||||
OperationsListNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing Operations operations. */
|
||||
export class OperationsImpl implements Operations {
|
||||
private readonly client: HybridConnectivityManagementAPI;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class Operations class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: HybridConnectivityManagementAPI) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the available Hybrid Connectivity REST API operations.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public list(
|
||||
options?: OperationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<Operation> {
|
||||
const iter = this.listPagingAll(options);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: (settings?: PageSettings) => {
|
||||
if (settings?.maxPageSize) {
|
||||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listPagingPage(options, settings);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listPagingPage(
|
||||
options?: OperationsListOptionalParams,
|
||||
settings?: PageSettings
|
||||
): AsyncIterableIterator<Operation[]> {
|
||||
let result: OperationsListResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
if (!continuationToken) {
|
||||
result = await this._list(options);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
while (continuationToken) {
|
||||
result = await this._listNext(continuationToken, options);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
}
|
||||
|
||||
private async *listPagingAll(
|
||||
options?: OperationsListOptionalParams
|
||||
): AsyncIterableIterator<Operation> {
|
||||
for await (const page of this.listPagingPage(options)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists the available Hybrid Connectivity REST API operations.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _list(
|
||||
options?: OperationsListOptionalParams
|
||||
): Promise<OperationsListResponse> {
|
||||
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListNext
|
||||
* @param nextLink The nextLink from the previous successful call to the List method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listNext(
|
||||
nextLink: string,
|
||||
options?: OperationsListNextOptionalParams
|
||||
): Promise<OperationsListNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ nextLink, options },
|
||||
listNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listOperationSpec: coreClient.OperationSpec = {
|
||||
path: "/providers/Microsoft.HybridConnectivity/operations",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.OperationListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [Parameters.$host],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.OperationListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [Parameters.$host, Parameters.nextLink],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,401 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
|
||||
import { setContinuationToken } from "../pagingHelper";
|
||||
import { ServiceConfigurations } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { HybridConnectivityManagementAPI } from "../hybridConnectivityManagementAPI";
|
||||
import {
|
||||
ServiceConfigurationResource,
|
||||
ServiceConfigurationsListByEndpointResourceNextOptionalParams,
|
||||
ServiceConfigurationsListByEndpointResourceOptionalParams,
|
||||
ServiceConfigurationsListByEndpointResourceResponse,
|
||||
ServiceConfigurationsGetOptionalParams,
|
||||
ServiceConfigurationsGetResponse,
|
||||
ServiceConfigurationsCreateOrupdateOptionalParams,
|
||||
ServiceConfigurationsCreateOrupdateResponse,
|
||||
ServiceConfigurationResourcePatch,
|
||||
ServiceConfigurationsUpdateOptionalParams,
|
||||
ServiceConfigurationsUpdateResponse,
|
||||
ServiceConfigurationsDeleteOptionalParams,
|
||||
ServiceConfigurationsListByEndpointResourceNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing ServiceConfigurations operations. */
|
||||
export class ServiceConfigurationsImpl implements ServiceConfigurations {
|
||||
private readonly client: HybridConnectivityManagementAPI;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class ServiceConfigurations class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: HybridConnectivityManagementAPI) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listByEndpointResource(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: ServiceConfigurationsListByEndpointResourceOptionalParams
|
||||
): PagedAsyncIterableIterator<ServiceConfigurationResource> {
|
||||
const iter = this.listByEndpointResourcePagingAll(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: (settings?: PageSettings) => {
|
||||
if (settings?.maxPageSize) {
|
||||
throw new Error("maxPageSize is not supported by this operation.");
|
||||
}
|
||||
return this.listByEndpointResourcePagingPage(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options,
|
||||
settings
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listByEndpointResourcePagingPage(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: ServiceConfigurationsListByEndpointResourceOptionalParams,
|
||||
settings?: PageSettings
|
||||
): AsyncIterableIterator<ServiceConfigurationResource[]> {
|
||||
let result: ServiceConfigurationsListByEndpointResourceResponse;
|
||||
let continuationToken = settings?.continuationToken;
|
||||
if (!continuationToken) {
|
||||
result = await this._listByEndpointResource(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
);
|
||||
let page = result.value || [];
|
||||
continuationToken = result.nextLink;
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
while (continuationToken) {
|
||||
result = await this._listByEndpointResourceNext(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
continuationToken,
|
||||
options
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
let page = result.value || [];
|
||||
setContinuationToken(page, continuationToken);
|
||||
yield page;
|
||||
}
|
||||
}
|
||||
|
||||
private async *listByEndpointResourcePagingAll(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: ServiceConfigurationsListByEndpointResourceOptionalParams
|
||||
): AsyncIterableIterator<ServiceConfigurationResource> {
|
||||
for await (const page of this.listByEndpointResourcePagingPage(
|
||||
resourceUri,
|
||||
endpointName,
|
||||
options
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByEndpointResource(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: ServiceConfigurationsListByEndpointResourceOptionalParams
|
||||
): Promise<ServiceConfigurationsListByEndpointResourceResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, options },
|
||||
listByEndpointResourceOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the details about the service to the resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
options?: ServiceConfigurationsGetOptionalParams
|
||||
): Promise<ServiceConfigurationsGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, serviceConfigurationName, options },
|
||||
getOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param serviceConfigurationResource Service details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
createOrupdate(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
serviceConfigurationResource: ServiceConfigurationResource,
|
||||
options?: ServiceConfigurationsCreateOrupdateOptionalParams
|
||||
): Promise<ServiceConfigurationsCreateOrupdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource,
|
||||
options
|
||||
},
|
||||
createOrupdateOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the service details in the service configurations of the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param serviceConfigurationResource Service details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
update(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
serviceConfigurationResource: ServiceConfigurationResourcePatch,
|
||||
options?: ServiceConfigurationsUpdateOptionalParams
|
||||
): Promise<ServiceConfigurationsUpdateResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{
|
||||
resourceUri,
|
||||
endpointName,
|
||||
serviceConfigurationName,
|
||||
serviceConfigurationResource,
|
||||
options
|
||||
},
|
||||
updateOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the service details to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
options?: ServiceConfigurationsDeleteOptionalParams
|
||||
): Promise<void> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, serviceConfigurationName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListByEndpointResourceNext
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param nextLink The nextLink from the previous successful call to the ListByEndpointResource method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByEndpointResourceNext(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
nextLink: string,
|
||||
options?: ServiceConfigurationsListByEndpointResourceNextOptionalParams
|
||||
): Promise<ServiceConfigurationsListByEndpointResourceNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceUri, endpointName, nextLink, options },
|
||||
listByEndpointResourceNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listByEndpointResourceOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ServiceConfigurationList
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ServiceConfigurationResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName,
|
||||
Parameters.serviceConfigurationName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const createOrupdateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ServiceConfigurationResource
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.ServiceConfigurationResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.serviceConfigurationResource,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName,
|
||||
Parameters.serviceConfigurationName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const updateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}",
|
||||
httpMethod: "PATCH",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ServiceConfigurationResource
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.serviceConfigurationResource1,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName,
|
||||
Parameters.serviceConfigurationName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/{resourceUri}/providers/Microsoft.HybridConnectivity/endpoints/{endpointName}/serviceConfigurations/{serviceConfigurationName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName,
|
||||
Parameters.serviceConfigurationName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const listByEndpointResourceNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ServiceConfigurationList
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.nextLink,
|
||||
Parameters.resourceUri,
|
||||
Parameters.endpointName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -0,0 +1,132 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 {
|
||||
EndpointResource,
|
||||
EndpointsListOptionalParams,
|
||||
EndpointsGetOptionalParams,
|
||||
EndpointsGetResponse,
|
||||
EndpointsCreateOrUpdateOptionalParams,
|
||||
EndpointsCreateOrUpdateResponse,
|
||||
EndpointsUpdateOptionalParams,
|
||||
EndpointsUpdateResponse,
|
||||
EndpointsDeleteOptionalParams,
|
||||
EndpointsListCredentialsOptionalParams,
|
||||
EndpointsListCredentialsResponse,
|
||||
EndpointsListIngressGatewayCredentialsOptionalParams,
|
||||
EndpointsListIngressGatewayCredentialsResponse,
|
||||
ManagedProxyRequest,
|
||||
EndpointsListManagedProxyDetailsOptionalParams,
|
||||
EndpointsListManagedProxyDetailsResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a Endpoints. */
|
||||
export interface Endpoints {
|
||||
/**
|
||||
* List of endpoints to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
list(
|
||||
resourceUri: string,
|
||||
options?: EndpointsListOptionalParams
|
||||
): PagedAsyncIterableIterator<EndpointResource>;
|
||||
/**
|
||||
* Gets the endpoint to the resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsGetOptionalParams
|
||||
): Promise<EndpointsGetResponse>;
|
||||
/**
|
||||
* Create or update the endpoint to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param endpointResource Endpoint details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
createOrUpdate(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
endpointResource: EndpointResource,
|
||||
options?: EndpointsCreateOrUpdateOptionalParams
|
||||
): Promise<EndpointsCreateOrUpdateResponse>;
|
||||
/**
|
||||
* Update the endpoint to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param endpointResource Endpoint details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
update(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
endpointResource: EndpointResource,
|
||||
options?: EndpointsUpdateOptionalParams
|
||||
): Promise<EndpointsUpdateResponse>;
|
||||
/**
|
||||
* Deletes the endpoint access to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsDeleteOptionalParams
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Gets the endpoint access credentials to the resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listCredentials(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsListCredentialsOptionalParams
|
||||
): Promise<EndpointsListCredentialsResponse>;
|
||||
/**
|
||||
* Gets the ingress gateway endpoint credentials
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listIngressGatewayCredentials(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: EndpointsListIngressGatewayCredentialsOptionalParams
|
||||
): Promise<EndpointsListIngressGatewayCredentialsResponse>;
|
||||
/**
|
||||
* Fetches the managed proxy details
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param managedProxyRequest Object of type ManagedProxyRequest
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listManagedProxyDetails(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
managedProxyRequest: ManagedProxyRequest,
|
||||
options?: EndpointsListManagedProxyDetailsOptionalParams
|
||||
): Promise<EndpointsListManagedProxyDetailsResponse>;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 "./operations";
|
||||
export * from "./endpoints";
|
||||
export * from "./serviceConfigurations";
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
||||
import { Operation, OperationsListOptionalParams } from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a Operations. */
|
||||
export interface Operations {
|
||||
/**
|
||||
* Lists the available Hybrid Connectivity REST API operations.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
list(
|
||||
options?: OperationsListOptionalParams
|
||||
): PagedAsyncIterableIterator<Operation>;
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 {
|
||||
ServiceConfigurationResource,
|
||||
ServiceConfigurationsListByEndpointResourceOptionalParams,
|
||||
ServiceConfigurationsGetOptionalParams,
|
||||
ServiceConfigurationsGetResponse,
|
||||
ServiceConfigurationsCreateOrupdateOptionalParams,
|
||||
ServiceConfigurationsCreateOrupdateResponse,
|
||||
ServiceConfigurationResourcePatch,
|
||||
ServiceConfigurationsUpdateOptionalParams,
|
||||
ServiceConfigurationsUpdateResponse,
|
||||
ServiceConfigurationsDeleteOptionalParams
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a ServiceConfigurations. */
|
||||
export interface ServiceConfigurations {
|
||||
/**
|
||||
* API to enumerate registered services in service configurations under a Endpoint Resource
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByEndpointResource(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
options?: ServiceConfigurationsListByEndpointResourceOptionalParams
|
||||
): PagedAsyncIterableIterator<ServiceConfigurationResource>;
|
||||
/**
|
||||
* Gets the details about the service to the resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
options?: ServiceConfigurationsGetOptionalParams
|
||||
): Promise<ServiceConfigurationsGetResponse>;
|
||||
/**
|
||||
* Create or update a service in serviceConfiguration for the endpoint resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param serviceConfigurationResource Service details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
createOrupdate(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
serviceConfigurationResource: ServiceConfigurationResource,
|
||||
options?: ServiceConfigurationsCreateOrupdateOptionalParams
|
||||
): Promise<ServiceConfigurationsCreateOrupdateResponse>;
|
||||
/**
|
||||
* Update the service details in the service configurations of the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param serviceConfigurationResource Service details
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
update(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
serviceConfigurationResource: ServiceConfigurationResourcePatch,
|
||||
options?: ServiceConfigurationsUpdateOptionalParams
|
||||
): Promise<ServiceConfigurationsUpdateResponse>;
|
||||
/**
|
||||
* Deletes the service details to the target resource.
|
||||
* @param resourceUri The fully qualified Azure Resource manager identifier of the resource to be
|
||||
* connected.
|
||||
* @param endpointName The endpoint name.
|
||||
* @param serviceConfigurationName The service name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
resourceUri: string,
|
||||
endpointName: string,
|
||||
serviceConfigurationName: string,
|
||||
options?: ServiceConfigurationsDeleteOptionalParams
|
||||
): Promise<void>;
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
export interface PageInfo {
|
||||
continuationToken?: string;
|
||||
}
|
||||
|
||||
const pageMap = new WeakMap<object, PageInfo>();
|
||||
|
||||
/**
|
||||
* Given the last `.value` produced by the `byPage` iterator,
|
||||
* returns a continuation token that can be used to begin paging from
|
||||
* that point later.
|
||||
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
||||
* @returns The continuation token that can be passed into byPage() during future calls.
|
||||
*/
|
||||
export function getContinuationToken(page: unknown): string | undefined {
|
||||
if (typeof page !== "object" || page === null) {
|
||||
return undefined;
|
||||
}
|
||||
return pageMap.get(page)?.continuationToken;
|
||||
}
|
||||
|
||||
export function setContinuationToken(
|
||||
page: unknown,
|
||||
continuationToken: string | undefined
|
||||
): void {
|
||||
if (typeof page !== "object" || page === null || !continuationToken) {
|
||||
return;
|
||||
}
|
||||
const pageInfo = pageMap.get(page) ?? {};
|
||||
pageInfo.continuationToken = continuationToken;
|
||||
pageMap.set(page, pageInfo);
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import {
|
||||
env,
|
||||
Recorder,
|
||||
RecorderStartOptions,
|
||||
delay,
|
||||
isPlaybackMode,
|
||||
} from "@azure-tools/test-recorder";
|
||||
import { createTestCredential } from "@azure-tools/test-credential";
|
||||
import { assert } from "chai";
|
||||
import { Context } from "mocha";
|
||||
import { HybridConnectivityManagementAPI } from "../src/hybridConnectivityManagementAPI";
|
||||
|
||||
const replaceableVariables: Record<string, string> = {
|
||||
AZURE_CLIENT_ID: "azure_client_id",
|
||||
AZURE_CLIENT_SECRET: "azure_client_secret",
|
||||
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
|
||||
SUBSCRIPTION_ID: "azure_subscription_id"
|
||||
};
|
||||
|
||||
const recorderOptions: RecorderStartOptions = {
|
||||
envSetupForPlayback: replaceableVariables
|
||||
};
|
||||
|
||||
export const testPollingOptions = {
|
||||
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
|
||||
};
|
||||
|
||||
describe("HybridConnectivity test", () => {
|
||||
let recorder: Recorder;
|
||||
let subscriptionId: string;
|
||||
let client: HybridConnectivityManagementAPI;
|
||||
let location: string;
|
||||
let resourceGroup: string;
|
||||
let resourcename: string;
|
||||
let resourceUri: string;
|
||||
|
||||
beforeEach(async function (this: Context) {
|
||||
recorder = new Recorder(this.currentTest);
|
||||
await recorder.start(recorderOptions);
|
||||
subscriptionId = env.SUBSCRIPTION_ID || '';
|
||||
// This is an example of how the environment variables are used
|
||||
const credential = createTestCredential();
|
||||
client = new HybridConnectivityManagementAPI(credential, recorder.configureClientOptions({}));
|
||||
location = "eastus";
|
||||
resourceGroup = "myjstest";
|
||||
resourcename = "default";
|
||||
resourceUri ="subscriptions/"+subscriptionId+"/resourceGroups/"+resourceGroup+"/providers/Microsoft.HybridCompute/machines/AWP-AzRael-01"
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
await recorder.stop();
|
||||
});
|
||||
|
||||
it("endpoints create test", async function () {
|
||||
|
||||
const res = await client.endpoints.createOrUpdate(
|
||||
resourceUri,
|
||||
resourcename,
|
||||
{
|
||||
properties: { type: "default" }
|
||||
});
|
||||
assert.equal(res.name, resourcename);
|
||||
});
|
||||
|
||||
it("endpoints get test", async function () {
|
||||
const res = await client.endpoints.get(resourceUri,
|
||||
resourcename);
|
||||
assert.equal(res.name, resourcename);
|
||||
});
|
||||
|
||||
it("endpoints list test", async function () {
|
||||
const resArray = new Array();
|
||||
for await (let item of client.endpoints.list(resourceUri)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
assert.equal(resArray.length, 1);
|
||||
});
|
||||
|
||||
it("endpoints delete test", async function () {
|
||||
const resArray = new Array();
|
||||
const res = await client.endpoints.delete(resourceUri,
|
||||
resourcename
|
||||
)
|
||||
for await (let item of client.endpoints.list(resourceUri)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
assert.equal(resArray.length, 0);
|
||||
});
|
||||
})
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "es6",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"declarationMap": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"declaration": true,
|
||||
"outDir": "./dist-esm",
|
||||
"importHelpers": true,
|
||||
"paths": {
|
||||
"@azure/arm-hybridconnectivity": [
|
||||
"./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/hybridconnectivity/arm-hybridconnectivity
|
||||
- sdk/hybridconnectivity/ci.mgmt.yml
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- feature/*
|
||||
- release/*
|
||||
- hotfix/*
|
||||
exclude:
|
||||
- feature/v4
|
||||
paths:
|
||||
include:
|
||||
- sdk/hybridconnectivity/arm-hybridconnectivity
|
||||
- sdk/hybridconnectivity/ci.mgmt.yml
|
||||
|
||||
extends:
|
||||
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
|
||||
parameters:
|
||||
ServiceDirectory: hybridconnectivity
|
||||
Artifacts:
|
||||
- name: azure-arm-hybridconnectivity
|
||||
safeName: azurearmhybridconnectivity
|
||||
|
Загрузка…
Ссылка в новой задаче