release extendedlocation package (#22653)
* release extendedlocation package * Update ci.mgmt.yml Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) <v-ziweichen@microsoft.com>
This commit is contained in:
Родитель
aae5c894e4
Коммит
581b2aea50
|
@ -11456,7 +11456,7 @@ packages:
|
|||
dev: false
|
||||
|
||||
file:projects/arm-extendedlocation.tgz:
|
||||
resolution: {integrity: sha512-qh8KGDnbqoUV6UbWCbFhWA3nCJ0WIhdO4VjeozivtHaTzV9lYUjn5gRIomUnuD/yIJXyKds2jCqOTAXMPxQiRQ==, tarball: file:projects/arm-extendedlocation.tgz}
|
||||
resolution: {integrity: sha512-doTH4270KxUQxTIvZfYxxS6wUC313p8DxC3amB6xPXoO4Vd7x3EtAHlXNEe0rs123rj5L7V/ouyJCds05SdHZQ==, tarball: file:projects/arm-extendedlocation.tgz}
|
||||
name: '@rush-temp/arm-extendedlocation'
|
||||
version: 0.0.0
|
||||
dependencies:
|
||||
|
@ -11465,19 +11465,21 @@ packages:
|
|||
'@microsoft/api-extractor': 7.18.11
|
||||
'@rollup/plugin-commonjs': 21.1.0_rollup@2.77.0
|
||||
'@rollup/plugin-json': 4.1.0_rollup@2.77.0
|
||||
'@rollup/plugin-multi-entry': 3.0.1_rollup@2.77.0
|
||||
'@rollup/plugin-node-resolve': 8.4.0_rollup@2.77.0
|
||||
'@rollup/plugin-multi-entry': 4.1.0_rollup@2.77.0
|
||||
'@rollup/plugin-node-resolve': 13.3.0_rollup@2.77.0
|
||||
'@types/chai': 4.3.1
|
||||
chai: 4.3.6
|
||||
cross-env: 7.0.3
|
||||
mkdirp: 1.0.4
|
||||
mocha: 7.2.0
|
||||
rimraf: 3.0.2
|
||||
rollup: 2.77.0
|
||||
rollup-plugin-sourcemaps: 0.4.2_rollup@2.77.0
|
||||
rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.0
|
||||
tslib: 2.4.0
|
||||
typescript: 4.2.4
|
||||
uglify-js: 3.16.2
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- supports-color
|
||||
- '@types/node'
|
||||
dev: false
|
||||
|
||||
file:projects/arm-features.tgz:
|
||||
|
|
|
@ -1,15 +1,44 @@
|
|||
## Release History
|
||||
# Release History
|
||||
|
||||
## 1.0.0-beta.2 (2022-07-20)
|
||||
|
||||
**Features**
|
||||
|
||||
### 1.0.0-beta.2 (Unreleased)
|
||||
- Added operation group ResourceSyncRules
|
||||
- Added operation CustomLocations.findTargetResourceGroup
|
||||
- Added Interface CustomLocation
|
||||
- Added Interface CustomLocationFindTargetResourceGroupProperties
|
||||
- Added Interface CustomLocationFindTargetResourceGroupResult
|
||||
- Added Interface CustomLocationsFindTargetResourceGroupOptionalParams
|
||||
- Added Interface EnabledResourceType
|
||||
- Added Interface MatchExpressionsProperties
|
||||
- Added Interface PatchableResourceSyncRule
|
||||
- Added Interface ProxyResource
|
||||
- Added Interface ResourceSyncRule
|
||||
- Added Interface ResourceSyncRuleListResult
|
||||
- Added Interface ResourceSyncRulePropertiesSelector
|
||||
- Added Interface ResourceSyncRulesCreateOrUpdateOptionalParams
|
||||
- Added Interface ResourceSyncRulesDeleteOptionalParams
|
||||
- Added Interface ResourceSyncRulesGetOptionalParams
|
||||
- Added Interface ResourceSyncRulesListByCustomLocationIDNextOptionalParams
|
||||
- Added Interface ResourceSyncRulesListByCustomLocationIDOptionalParams
|
||||
- Added Interface ResourceSyncRulesUpdateOptionalParams
|
||||
- Added Interface TrackedResource
|
||||
- Added Type Alias CustomLocationsFindTargetResourceGroupResponse
|
||||
- Added Type Alias ResourceSyncRulesCreateOrUpdateResponse
|
||||
- Added Type Alias ResourceSyncRulesGetResponse
|
||||
- Added Type Alias ResourceSyncRulesListByCustomLocationIDNextResponse
|
||||
- Added Type Alias ResourceSyncRulesListByCustomLocationIDResponse
|
||||
- Added Type Alias ResourceSyncRulesUpdateResponse
|
||||
- Class CustomLocationsManagementClient has a new parameter $host
|
||||
- Class CustomLocationsManagementClient has a new parameter apiVersion
|
||||
- Class CustomLocationsManagementClient has a new parameter resourceSyncRules
|
||||
- Class CustomLocationsManagementClient has a new parameter subscriptionId
|
||||
|
||||
#### Features Added
|
||||
**Breaking Changes**
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
#### Bugs Fixed
|
||||
|
||||
#### Other Changes
|
||||
|
||||
### 1.0.0-beta.1 (2021-10-08)
|
||||
- Deleted Class CustomLocationsManagementClientContext
|
||||
|
||||
## 1.0.0-beta.1 (2021-10-08)
|
||||
|
||||
- Initial Release
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2021 Microsoft
|
||||
Copyright (c) 2022 Microsoft
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
# Azure customLocationsManagement client library for JavaScript
|
||||
# Azure CustomLocationsManagement client library for JavaScript
|
||||
|
||||
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure customLocationsManagement client.
|
||||
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure CustomLocationsManagement client.
|
||||
|
||||
The customLocations Rest API spec.
|
||||
|
||||
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation) |
|
||||
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-extendedlocation) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation) |
|
||||
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation?view=azure-node-preview) |
|
||||
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
||||
|
||||
## Getting started
|
||||
|
@ -16,13 +16,15 @@ The customLocations Rest API spec.
|
|||
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
|
||||
- Latest versions of Safari, Chrome, Edge and Firefox.
|
||||
|
||||
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- An [Azure subscription][azure_sub].
|
||||
|
||||
### Install the `@azure/arm-extendedlocation` package
|
||||
|
||||
Install the Azure customLocationsManagement client library for JavaScript with `npm`:
|
||||
Install the Azure CustomLocationsManagement client library for JavaScript with `npm`:
|
||||
|
||||
```bash
|
||||
npm install @azure/arm-extendedlocation
|
||||
|
@ -30,8 +32,8 @@ npm install @azure/arm-extendedlocation
|
|||
|
||||
### Create and authenticate a `CustomLocationsManagementClient`
|
||||
|
||||
To create a client object to access the Azure customLocationsManagement API, you will need the `endpoint` of your Azure customLocationsManagement resource and a `credential`. The Azure customLocationsManagement client can use Azure Active Directory credentials to authenticate.
|
||||
You can find the endpoint for your Azure customLocationsManagement resource in the [Azure Portal][azure_portal].
|
||||
To create a client object to access the Azure CustomLocationsManagement API, you will need the `endpoint` of your Azure CustomLocationsManagement resource and a `credential`. The Azure CustomLocationsManagement client can use Azure Active Directory credentials to authenticate.
|
||||
You can find the endpoint for your Azure CustomLocationsManagement 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).
|
||||
|
||||
|
@ -41,7 +43,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
|
|||
npm install @azure/identity
|
||||
```
|
||||
|
||||
You will also need to **register a new AAD application and grant access to Azure customLocationsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
|
||||
You will also need to **register a new AAD application and grant access to Azure CustomLocationsManagement** 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).
|
||||
|
@ -49,15 +51,28 @@ For more information about how to create an Azure AD Application check out [this
|
|||
```javascript
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
|
||||
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const client = new CustomLocationsManagementClient(new DefaultAzureCredential(), subscriptionId);
|
||||
|
||||
// For client-side applications running in the browser, use this code instead:
|
||||
// const credential = new InteractiveBrowserCredential({
|
||||
// tenantId: "<YOUR_TENANT_ID>",
|
||||
// clientId: "<YOUR_CLIENT_ID>"
|
||||
// });
|
||||
// const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
```
|
||||
|
||||
|
||||
### JavaScript Bundle
|
||||
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
|
||||
|
||||
## Key concepts
|
||||
|
||||
### CustomLocationsManagementClient
|
||||
|
||||
`CustomLocationsManagementClient` is the primary interface for developers using the Azure customLocationsManagement client library. Explore the methods on this client object to understand the different features of the Azure customLocationsManagement service that you can access.
|
||||
`CustomLocationsManagementClient` is the primary interface for developers using the Azure CustomLocationsManagement client library. Explore the methods on this client object to understand the different features of the Azure CustomLocationsManagement service that you can access.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"commit": "5cf3e4a0c30ad5167088ac839453578b2e8e9afc",
|
||||
"commit": "ca5d9600e4950afdae3c23c71d9407b6aa3fce63",
|
||||
"readme": "specification/extendedlocation/resource-manager/readme.md",
|
||||
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/extendedlocation/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.13",
|
||||
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\extendedlocation\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"use": "@autorest/typescript@6.0.0-beta.13"
|
||||
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.0",
|
||||
"use": "@autorest/typescript@6.0.0-rc.1"
|
||||
}
|
|
@ -1,18 +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" },
|
||||
"docModel": {
|
||||
"enabled": true
|
||||
},
|
||||
"apiReport": {
|
||||
"enabled": true,
|
||||
"reportFolder": "./review"
|
||||
},
|
||||
"dtsRollup": {
|
||||
"enabled": true,
|
||||
"untrimmedFilePath": "",
|
||||
"publicTrimmedFilePath": "./types/arm-extendedlocation.d.ts"
|
||||
},
|
||||
"messages": {
|
||||
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
"extractorMessageReporting": {
|
||||
"ae-missing-release-tag": { "logLevel": "none" },
|
||||
"ae-unresolved-link": { "logLevel": "none" }
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
},
|
||||
"ae-unresolved-link": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,10 +10,10 @@
|
|||
"dependencies": {
|
||||
"@azure/core-lro": "^2.2.0",
|
||||
"@azure/abort-controller": "^1.0.0",
|
||||
"@azure/core-paging": "^1.1.1",
|
||||
"@azure/core-client": "^1.0.0",
|
||||
"@azure/core-paging": "^1.2.0",
|
||||
"@azure/core-client": "^1.5.0",
|
||||
"@azure/core-auth": "^1.3.0",
|
||||
"@azure/core-rest-pipeline": "^1.1.0",
|
||||
"@azure/core-rest-pipeline": "^1.8.0",
|
||||
"tslib": "^2.2.0"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -30,18 +30,23 @@
|
|||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "7.18.11",
|
||||
"@rollup/plugin-commonjs": "^21.0.1",
|
||||
"@rollup/plugin-json": "^4.0.0",
|
||||
"@rollup/plugin-multi-entry": "^3.0.0",
|
||||
"@rollup/plugin-node-resolve": "^8.0.0",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-multi-entry": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||
"mkdirp": "^1.0.4",
|
||||
"rollup": "^2.0.0",
|
||||
"rollup-plugin-sourcemaps": "^0.4.2",
|
||||
"rollup": "^2.66.1",
|
||||
"rollup-plugin-sourcemaps": "^0.6.3",
|
||||
"typescript": "~4.2.0",
|
||||
"uglify-js": "^3.4.9",
|
||||
"rimraf": "^3.0.0",
|
||||
"@azure/identity": "^2.0.1",
|
||||
"@azure-tools/test-recorder": "^1.0.0",
|
||||
"@azure-tools/test-recorder": "^2.0.0",
|
||||
"@azure-tools/test-credential": "^1.0.0",
|
||||
"mocha": "^7.1.1",
|
||||
"cross-env": "^7.0.2"
|
||||
"@types/chai": "^4.2.8",
|
||||
"chai": "^4.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"@azure/dev-tool": "^1.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation",
|
||||
"repository": {
|
||||
|
@ -70,14 +75,14 @@
|
|||
"types/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
||||
"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": "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",
|
||||
|
@ -86,17 +91,31 @@
|
|||
"execute:samples": "echo skipped",
|
||||
"format": "echo skipped",
|
||||
"test": "npm run integration-test",
|
||||
"prebuild": "echo skipped",
|
||||
"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": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts",
|
||||
"integration-test:browser": "echo skipped",
|
||||
"docs": "echo skipped"
|
||||
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
|
||||
"integration-test:browser": "echo skipped"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"autoPublish": true
|
||||
}
|
||||
"//metadata": {
|
||||
"constantPaths": [
|
||||
{
|
||||
"path": "src/customLocationsManagementClient.ts",
|
||||
"prefix": "packageDetails"
|
||||
}
|
||||
]
|
||||
},
|
||||
"autoPublish": true,
|
||||
"//sampleConfiguration": {
|
||||
"productName": "",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
],
|
||||
"disableDocsMs": true,
|
||||
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation?view=azure-node-preview"
|
||||
}
|
||||
}
|
4
sdk/extendedlocation/arm-extendedlocation/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
4
sdk/extendedlocation/arm-extendedlocation/recordings/node/my_test/recording_sample_test.json
сгенерированный
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"Entries": [],
|
||||
"Variables": {}
|
||||
}
|
|
@ -14,17 +14,30 @@ import { PollOperationState } from '@azure/core-lro';
|
|||
export type CreatedByType = string;
|
||||
|
||||
// @public
|
||||
export type CustomLocation = TrackedResource & {
|
||||
identity?: Identity;
|
||||
readonly systemData?: SystemData;
|
||||
export interface CustomLocation extends TrackedResource {
|
||||
authentication?: CustomLocationPropertiesAuthentication;
|
||||
clusterExtensionIds?: string[];
|
||||
displayName?: string;
|
||||
hostResourceId?: string;
|
||||
hostType?: HostType;
|
||||
identity?: Identity;
|
||||
namespace?: string;
|
||||
provisioningState?: string;
|
||||
};
|
||||
readonly systemData?: SystemData;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface CustomLocationFindTargetResourceGroupProperties {
|
||||
labels?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface CustomLocationFindTargetResourceGroupResult {
|
||||
readonly matchedResourceSyncRule?: string;
|
||||
readonly targetResourceGroup?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface CustomLocationListResult {
|
||||
|
@ -61,6 +74,7 @@ export interface CustomLocations {
|
|||
beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: CustomLocation, options?: CustomLocationsCreateOrUpdateOptionalParams): Promise<CustomLocationsCreateOrUpdateResponse>;
|
||||
beginDelete(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
|
||||
beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise<void>;
|
||||
findTargetResourceGroup(resourceGroupName: string, resourceName: string, parameters: CustomLocationFindTargetResourceGroupProperties, options?: CustomLocationsFindTargetResourceGroupOptionalParams): Promise<CustomLocationsFindTargetResourceGroupResponse>;
|
||||
get(resourceGroupName: string, resourceName: string, options?: CustomLocationsGetOptionalParams): Promise<CustomLocationsGetResponse>;
|
||||
listByResourceGroup(resourceGroupName: string, options?: CustomLocationsListByResourceGroupOptionalParams): PagedAsyncIterableIterator<CustomLocation>;
|
||||
listBySubscription(options?: CustomLocationsListBySubscriptionOptionalParams): PagedAsyncIterableIterator<CustomLocation>;
|
||||
|
@ -84,6 +98,13 @@ export interface CustomLocationsDeleteOptionalParams extends coreClient.Operatio
|
|||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface CustomLocationsFindTargetResourceGroupOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type CustomLocationsFindTargetResourceGroupResponse = CustomLocationFindTargetResourceGroupResult;
|
||||
|
||||
// @public
|
||||
export interface CustomLocationsGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
@ -148,20 +169,17 @@ export interface CustomLocationsListOperationsOptionalParams extends coreClient.
|
|||
export type CustomLocationsListOperationsResponse = CustomLocationOperationsList;
|
||||
|
||||
// @public (undocumented)
|
||||
export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
|
||||
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams);
|
||||
// (undocumented)
|
||||
customLocations: CustomLocations;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export class CustomLocationsManagementClientContext extends coreClient.ServiceClient {
|
||||
export class CustomLocationsManagementClient extends coreClient.ServiceClient {
|
||||
// (undocumented)
|
||||
$host: string;
|
||||
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams);
|
||||
// (undocumented)
|
||||
apiVersion: string;
|
||||
// (undocumented)
|
||||
customLocations: CustomLocations;
|
||||
// (undocumented)
|
||||
resourceSyncRules: ResourceSyncRules;
|
||||
// (undocumented)
|
||||
subscriptionId: string;
|
||||
}
|
||||
|
||||
|
@ -191,12 +209,12 @@ export interface CustomLocationsUpdateOptionalParams extends coreClient.Operatio
|
|||
export type CustomLocationsUpdateResponse = CustomLocation;
|
||||
|
||||
// @public
|
||||
export type EnabledResourceType = ProxyResource & {
|
||||
readonly systemData?: SystemData;
|
||||
export interface EnabledResourceType extends ProxyResource {
|
||||
clusterExtensionId?: string;
|
||||
extensionType?: string;
|
||||
readonly systemData?: SystemData;
|
||||
typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[];
|
||||
};
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface EnabledResourceTypePropertiesTypesMetadataItem {
|
||||
|
@ -243,30 +261,30 @@ export interface Identity {
|
|||
|
||||
// @public
|
||||
export enum KnownCreatedByType {
|
||||
// (undocumented)
|
||||
Application = "Application",
|
||||
// (undocumented)
|
||||
Key = "Key",
|
||||
// (undocumented)
|
||||
ManagedIdentity = "ManagedIdentity",
|
||||
// (undocumented)
|
||||
User = "User"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownHostType {
|
||||
// (undocumented)
|
||||
Kubernetes = "Kubernetes"
|
||||
}
|
||||
|
||||
// @public
|
||||
export enum KnownResourceIdentityType {
|
||||
// (undocumented)
|
||||
None = "None",
|
||||
// (undocumented)
|
||||
SystemAssigned = "SystemAssigned"
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface MatchExpressionsProperties {
|
||||
key?: string;
|
||||
operator?: string;
|
||||
values?: string[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface PatchableCustomLocations {
|
||||
authentication?: CustomLocationPropertiesAuthentication;
|
||||
|
@ -283,7 +301,19 @@ export interface PatchableCustomLocations {
|
|||
}
|
||||
|
||||
// @public
|
||||
export type ProxyResource = Resource & {};
|
||||
export interface PatchableResourceSyncRule {
|
||||
priority?: number;
|
||||
readonly provisioningState?: string;
|
||||
selector?: ResourceSyncRulePropertiesSelector;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
targetResourceGroup?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ProxyResource extends Resource {
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface Resource {
|
||||
|
@ -295,6 +325,89 @@ export interface Resource {
|
|||
// @public
|
||||
export type ResourceIdentityType = string;
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRule extends TrackedResource {
|
||||
priority?: number;
|
||||
readonly provisioningState?: string;
|
||||
selector?: ResourceSyncRulePropertiesSelector;
|
||||
readonly systemData?: SystemData;
|
||||
targetResourceGroup?: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRuleListResult {
|
||||
readonly nextLink?: string;
|
||||
readonly value?: ResourceSyncRule[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRulePropertiesSelector {
|
||||
matchExpressions?: MatchExpressionsProperties[];
|
||||
matchLabels?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRules {
|
||||
beginCreateOrUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, parameters: ResourceSyncRule, options?: ResourceSyncRulesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<ResourceSyncRulesCreateOrUpdateResponse>, ResourceSyncRulesCreateOrUpdateResponse>>;
|
||||
beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, childResourceName: string, parameters: ResourceSyncRule, options?: ResourceSyncRulesCreateOrUpdateOptionalParams): Promise<ResourceSyncRulesCreateOrUpdateResponse>;
|
||||
beginUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise<PollerLike<PollOperationState<ResourceSyncRulesUpdateResponse>, ResourceSyncRulesUpdateResponse>>;
|
||||
beginUpdateAndWait(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise<ResourceSyncRulesUpdateResponse>;
|
||||
delete(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesDeleteOptionalParams): Promise<void>;
|
||||
get(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesGetOptionalParams): Promise<ResourceSyncRulesGetResponse>;
|
||||
listByCustomLocationID(resourceGroupName: string, resourceName: string, options?: ResourceSyncRulesListByCustomLocationIDOptionalParams): PagedAsyncIterableIterator<ResourceSyncRule>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
resumeFrom?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ResourceSyncRulesCreateOrUpdateResponse = ResourceSyncRule;
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRulesDeleteOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRulesGetOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ResourceSyncRulesGetResponse = ResourceSyncRule;
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRulesListByCustomLocationIDNextOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ResourceSyncRulesListByCustomLocationIDNextResponse = ResourceSyncRuleListResult;
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRulesListByCustomLocationIDOptionalParams extends coreClient.OperationOptions {
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ResourceSyncRulesListByCustomLocationIDResponse = ResourceSyncRuleListResult;
|
||||
|
||||
// @public
|
||||
export interface ResourceSyncRulesUpdateOptionalParams extends coreClient.OperationOptions {
|
||||
priority?: number;
|
||||
resumeFrom?: string;
|
||||
selector?: ResourceSyncRulePropertiesSelector;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
targetResourceGroup?: string;
|
||||
updateIntervalInMs?: number;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ResourceSyncRulesUpdateResponse = ResourceSyncRule;
|
||||
|
||||
// @public
|
||||
export interface SystemData {
|
||||
createdAt?: Date;
|
||||
|
@ -306,13 +419,12 @@ export interface SystemData {
|
|||
}
|
||||
|
||||
// @public
|
||||
export type TrackedResource = Resource & {
|
||||
export interface TrackedResource extends Resource {
|
||||
location: string;
|
||||
tags?: {
|
||||
[propertyName: string]: string;
|
||||
};
|
||||
location: string;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
|
|
|
@ -14,62 +14,14 @@ import json from "@rollup/plugin-json";
|
|||
|
||||
import nodeBuiltins from "builtin-modules";
|
||||
|
||||
/**
|
||||
* Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
|
||||
*
|
||||
* NOTE: this manual configuration is only needed because OpenTelemetry uses an
|
||||
* __exportStar downleveled helper function to declare its exports which confuses
|
||||
* rollup's automatic discovery mechanism.
|
||||
*
|
||||
* @returns an object reference that can be `...`'d into your cjs() configuration.
|
||||
*/
|
||||
export function openTelemetryCommonJs() {
|
||||
const namedExports = {};
|
||||
|
||||
for (const key of [
|
||||
"@opentelemetry/api",
|
||||
"@azure/core-tracing/node_modules/@opentelemetry/api"
|
||||
]) {
|
||||
namedExports[key] = [
|
||||
"SpanKind",
|
||||
"TraceFlags",
|
||||
"getSpan",
|
||||
"setSpan",
|
||||
"SpanStatusCode",
|
||||
"getSpanContext",
|
||||
"setSpanContext"
|
||||
];
|
||||
}
|
||||
|
||||
const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
|
||||
|
||||
for (const version of releasedOpenTelemetryVersions) {
|
||||
namedExports[
|
||||
// working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
|
||||
`../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
|
||||
] = [
|
||||
"SpanKind",
|
||||
"TraceFlags",
|
||||
"getSpan",
|
||||
"setSpan",
|
||||
"StatusCode",
|
||||
"CanonicalCode",
|
||||
"getSpanContext",
|
||||
"setSpanContext"
|
||||
];
|
||||
}
|
||||
|
||||
return namedExports;
|
||||
}
|
||||
|
||||
// #region Warning Handler
|
||||
|
||||
/**
|
||||
* A function that can determine whether a rollupwarning should be ignored. If
|
||||
* 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 ignoreNiseSinonEvalWarnings(warning) {
|
||||
function ignoreNiseSinonEval(warning) {
|
||||
return (
|
||||
warning.code === "EVAL" &&
|
||||
warning.id &&
|
||||
|
@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) {
|
|||
);
|
||||
}
|
||||
|
||||
function ignoreChaiCircularDependencyWarnings(warning) {
|
||||
function ignoreChaiCircularDependency(warning) {
|
||||
return (
|
||||
warning.code === "CIRCULAR_DEPENDENCY" &&
|
||||
warning.importer && warning.importer.includes("node_modules/chai") === true
|
||||
);
|
||||
}
|
||||
|
||||
const warningInhibitors = [
|
||||
ignoreChaiCircularDependencyWarnings,
|
||||
ignoreNiseSinonEvalWarnings
|
||||
];
|
||||
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
|
||||
|
||||
/**
|
||||
* Construct a warning handler for the shared rollup configuration
|
||||
|
@ -122,22 +71,7 @@ function makeBrowserTestConfig() {
|
|||
nodeResolve({
|
||||
mainFields: ["module", "browser"]
|
||||
}),
|
||||
cjs({
|
||||
namedExports: {
|
||||
// Chai's strange internal architecture makes it impossible to statically
|
||||
// analyze its exports.
|
||||
chai: [
|
||||
"version",
|
||||
"use",
|
||||
"util",
|
||||
"config",
|
||||
"expect",
|
||||
"should",
|
||||
"assert"
|
||||
],
|
||||
...openTelemetryCommonJs()
|
||||
}
|
||||
}),
|
||||
cjs(),
|
||||
json(),
|
||||
sourcemaps()
|
||||
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
||||
|
@ -173,7 +107,7 @@ export function makeConfig(pkg, options) {
|
|||
],
|
||||
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
||||
preserveSymlinks: false,
|
||||
plugins: [sourcemaps(), nodeResolve(), cjs()]
|
||||
plugins: [sourcemaps(), nodeResolve()]
|
||||
};
|
||||
|
||||
const config = [baseConfig];
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
CustomLocation,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Custom Location in the specified Subscription and Resource Group
|
||||
*
|
||||
* @summary Creates or updates a Custom Location in the specified Subscription and Resource Group
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsCreate_Update.json
|
||||
*/
|
||||
async function createOrUpdateCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const parameters: CustomLocation = {
|
||||
authentication: { type: "KubeConfig", value: "<base64 KubeConfig>" },
|
||||
clusterExtensionIds: [
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedCluster/someCluster/Microsoft.KubernetesConfiguration/clusterExtensions/fooExtension"
|
||||
],
|
||||
displayName: "customLocationLocation01",
|
||||
hostResourceId:
|
||||
"/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup/providers/Microsoft.ContainerService/managedClusters/cluster01",
|
||||
identity: { type: "SystemAssigned" },
|
||||
location: "West US",
|
||||
namespace: "namespace01"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createOrUpdateCustomLocation().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id.
|
||||
*
|
||||
* @summary Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsDelete.json
|
||||
*/
|
||||
async function deleteCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCustomLocation().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 {
|
||||
CustomLocationFindTargetResourceGroupProperties,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.
|
||||
*
|
||||
* @summary Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsFindTargetResourceGroup.json
|
||||
*/
|
||||
async function postCustomLocationFindTargetResourceGroup() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const parameters: CustomLocationFindTargetResourceGroupProperties = {
|
||||
labels: { key1: "value1", key2: "value2" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.findTargetResourceGroup(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
postCustomLocationFindTargetResourceGroup().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details of the customLocation with a specified resource group and name.
|
||||
*
|
||||
* @summary Gets the details of the customLocation with a specified resource group and name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsGet.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.get(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCustomLocation().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 { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location.
|
||||
*
|
||||
* @summary Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListByResourceGroup.json
|
||||
*/
|
||||
async function listCustomLocationsByResourceGroup() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location
|
||||
*
|
||||
* @summary Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListBySubscription.json
|
||||
*/
|
||||
async function listCustomLocationsBySubscription() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listBySubscription()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsBySubscription().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 { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the list of the Enabled Resource Types.
|
||||
*
|
||||
* @summary Gets the list of the Enabled Resource Types.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListEnabledResourceTypes.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listEnabledResourceTypes(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getCustomLocation().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all available Custom Locations operations.
|
||||
*
|
||||
* @summary Lists all available Custom Locations operations.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListOperations.json
|
||||
*/
|
||||
async function listCustomLocationsOperations() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listOperations()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsOperations().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 {
|
||||
CustomLocationsUpdateOptionalParams,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription.
|
||||
*
|
||||
* @summary Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsPatch.json
|
||||
*/
|
||||
async function updateCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const identity = { type: "SystemAssigned" };
|
||||
const tags = { archv3: "", tier: "testing" };
|
||||
const options: CustomLocationsUpdateOptionalParams = { identity, tags };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.update(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateCustomLocation().catch(console.error);
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ResourceSyncRule,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group
|
||||
*
|
||||
* @summary Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesCreate_Update.json
|
||||
*/
|
||||
async function createOrUpdateResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const parameters: ResourceSyncRule = {
|
||||
location: "West US",
|
||||
priority: 999,
|
||||
selector: {
|
||||
matchExpressions: [{ key: "key4", operator: "In", values: ["value4"] }],
|
||||
matchLabels: { key1: "value1" }
|
||||
},
|
||||
targetResourceGroup:
|
||||
"/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createOrUpdateResourceSyncRule().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
|
||||
*
|
||||
* @summary Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesDelete.json
|
||||
*/
|
||||
async function deleteResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.delete(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteResourceSyncRule().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
|
||||
*
|
||||
* @summary Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesGet.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.get(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCustomLocation().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 { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
|
||||
*
|
||||
* @summary Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesListByCustomLocationID.json
|
||||
*/
|
||||
async function listResourceSyncRulesBySubscription() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.resourceSyncRules.listByCustomLocationID(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listResourceSyncRulesBySubscription().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ResourceSyncRulesUpdateOptionalParams,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.
|
||||
*
|
||||
* @summary Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesPatch.json
|
||||
*/
|
||||
async function updateResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const tags = { tier: "testing" };
|
||||
const options: ResourceSyncRulesUpdateOptionalParams = { tags };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateResourceSyncRule().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** |
|
||||
| ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [customLocationsCreateOrUpdateSample.js][customlocationscreateorupdatesample] | Creates or updates a Custom Location in the specified Subscription and Resource Group x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsCreate_Update.json |
|
||||
| [customLocationsDeleteSample.js][customlocationsdeletesample] | Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsDelete.json |
|
||||
| [customLocationsFindTargetResourceGroupSample.js][customlocationsfindtargetresourcegroupsample] | Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsFindTargetResourceGroup.json |
|
||||
| [customLocationsGetSample.js][customlocationsgetsample] | Gets the details of the customLocation with a specified resource group and name. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsGet.json |
|
||||
| [customLocationsListByResourceGroupSample.js][customlocationslistbyresourcegroupsample] | Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListByResourceGroup.json |
|
||||
| [customLocationsListBySubscriptionSample.js][customlocationslistbysubscriptionsample] | Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListBySubscription.json |
|
||||
| [customLocationsListEnabledResourceTypesSample.js][customlocationslistenabledresourcetypessample] | Gets the list of the Enabled Resource Types. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListEnabledResourceTypes.json |
|
||||
| [customLocationsListOperationsSample.js][customlocationslistoperationssample] | Lists all available Custom Locations operations. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListOperations.json |
|
||||
| [customLocationsUpdateSample.js][customlocationsupdatesample] | Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsPatch.json |
|
||||
| [resourceSyncRulesCreateOrUpdateSample.js][resourcesyncrulescreateorupdatesample] | Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesCreate_Update.json |
|
||||
| [resourceSyncRulesDeleteSample.js][resourcesyncrulesdeletesample] | Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesDelete.json |
|
||||
| [resourceSyncRulesGetSample.js][resourcesyncrulesgetsample] | Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesGet.json |
|
||||
| [resourceSyncRulesListByCustomLocationIdSample.js][resourcesyncruleslistbycustomlocationidsample] | Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesListByCustomLocationID.json |
|
||||
| [resourceSyncRulesUpdateSample.js][resourcesyncrulesupdatesample] | Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesPatch.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node customLocationsCreateOrUpdateSample.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 customLocationsCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[customlocationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsCreateOrUpdateSample.js
|
||||
[customlocationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsDeleteSample.js
|
||||
[customlocationsfindtargetresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsFindTargetResourceGroupSample.js
|
||||
[customlocationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsGetSample.js
|
||||
[customlocationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsListByResourceGroupSample.js
|
||||
[customlocationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsListBySubscriptionSample.js
|
||||
[customlocationslistenabledresourcetypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsListEnabledResourceTypesSample.js
|
||||
[customlocationslistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsListOperationsSample.js
|
||||
[customlocationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/customLocationsUpdateSample.js
|
||||
[resourcesyncrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/resourceSyncRulesCreateOrUpdateSample.js
|
||||
[resourcesyncrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/resourceSyncRulesDeleteSample.js
|
||||
[resourcesyncrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/resourceSyncRulesGetSample.js
|
||||
[resourcesyncruleslistbycustomlocationidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/resourceSyncRulesListByCustomLocationIdSample.js
|
||||
[resourcesyncrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/javascript/resourceSyncRulesUpdateSample.js
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation/README.md
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Custom Location in the specified Subscription and Resource Group
|
||||
*
|
||||
* @summary Creates or updates a Custom Location in the specified Subscription and Resource Group
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsCreate_Update.json
|
||||
*/
|
||||
async function createOrUpdateCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const parameters = {
|
||||
authentication: { type: "KubeConfig", value: "<base64 KubeConfig>" },
|
||||
clusterExtensionIds: [
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedCluster/someCluster/Microsoft.KubernetesConfiguration/clusterExtensions/fooExtension",
|
||||
],
|
||||
displayName: "customLocationLocation01",
|
||||
hostResourceId:
|
||||
"/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup/providers/Microsoft.ContainerService/managedClusters/cluster01",
|
||||
identity: { type: "SystemAssigned" },
|
||||
location: "West US",
|
||||
namespace: "namespace01",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.customLocations.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createOrUpdateCustomLocation().catch(console.error);
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id.
|
||||
*
|
||||
* @summary Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsDelete.json
|
||||
*/
|
||||
async function deleteCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.customLocations.beginDeleteAndWait(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCustomLocation().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 { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.
|
||||
*
|
||||
* @summary Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsFindTargetResourceGroup.json
|
||||
*/
|
||||
async function postCustomLocationFindTargetResourceGroup() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const parameters = {
|
||||
labels: { key1: "value1", key2: "value2" },
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.customLocations.findTargetResourceGroup(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
postCustomLocationFindTargetResourceGroup().catch(console.error);
|
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details of the customLocation with a specified resource group and name.
|
||||
*
|
||||
* @summary Gets the details of the customLocation with a specified resource group and name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsGet.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.customLocations.get(resourceGroupName, resourceName);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCustomLocation().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location.
|
||||
*
|
||||
* @summary Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListByResourceGroup.json
|
||||
*/
|
||||
async function listCustomLocationsByResourceGroup() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listByResourceGroup(resourceGroupName)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location
|
||||
*
|
||||
* @summary Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListBySubscription.json
|
||||
*/
|
||||
async function listCustomLocationsBySubscription() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listBySubscription()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsBySubscription().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the list of the Enabled Resource Types.
|
||||
*
|
||||
* @summary Gets the list of the Enabled Resource Types.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListEnabledResourceTypes.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listEnabledResourceTypes(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getCustomLocation().catch(console.error);
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all available Custom Locations operations.
|
||||
*
|
||||
* @summary Lists all available Custom Locations operations.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListOperations.json
|
||||
*/
|
||||
async function listCustomLocationsOperations() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listOperations()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsOperations().catch(console.error);
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription.
|
||||
*
|
||||
* @summary Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsPatch.json
|
||||
*/
|
||||
async function updateCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const identity = { type: "SystemAssigned" };
|
||||
const tags = { archv3: "", tier: "testing" };
|
||||
const options = { identity, tags };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.customLocations.update(resourceGroupName, resourceName, options);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateCustomLocation().catch(console.error);
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-extendedlocation-js-beta",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for JavaScript (Beta)",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/extendedlocation/arm-extendedlocation"
|
||||
},
|
||||
"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/extendedlocation/arm-extendedlocation",
|
||||
"dependencies": {
|
||||
"@azure/arm-extendedlocation": "next",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group
|
||||
*
|
||||
* @summary Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesCreate_Update.json
|
||||
*/
|
||||
async function createOrUpdateResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const parameters = {
|
||||
location: "West US",
|
||||
priority: 999,
|
||||
selector: {
|
||||
matchExpressions: [{ key: "key4", operator: "In", values: ["value4"] }],
|
||||
matchLabels: { key1: "value1" },
|
||||
},
|
||||
targetResourceGroup:
|
||||
"/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup",
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.resourceSyncRules.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createOrUpdateResourceSyncRule().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 { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
|
||||
*
|
||||
* @summary Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesDelete.json
|
||||
*/
|
||||
async function deleteResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.resourceSyncRules.delete(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteResourceSyncRule().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 { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
|
||||
*
|
||||
* @summary Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesGet.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.resourceSyncRules.get(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCustomLocation().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
const { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
|
||||
*
|
||||
* @summary Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesListByCustomLocationID.json
|
||||
*/
|
||||
async function listResourceSyncRulesBySubscription() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.resourceSyncRules.listByCustomLocationID(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listResourceSyncRulesBySubscription().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 { CustomLocationsManagementClient } = require("@azure/arm-extendedlocation");
|
||||
const { DefaultAzureCredential } = require("@azure/identity");
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.
|
||||
*
|
||||
* @summary Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesPatch.json
|
||||
*/
|
||||
async function updateResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const tags = { tier: "testing" };
|
||||
const options = { tags };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(credential, subscriptionId);
|
||||
const result = await client.resourceSyncRules.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateResourceSyncRule().catch(console.error);
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -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** |
|
||||
| ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [customLocationsCreateOrUpdateSample.ts][customlocationscreateorupdatesample] | Creates or updates a Custom Location in the specified Subscription and Resource Group x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsCreate_Update.json |
|
||||
| [customLocationsDeleteSample.ts][customlocationsdeletesample] | Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsDelete.json |
|
||||
| [customLocationsFindTargetResourceGroupSample.ts][customlocationsfindtargetresourcegroupsample] | Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsFindTargetResourceGroup.json |
|
||||
| [customLocationsGetSample.ts][customlocationsgetsample] | Gets the details of the customLocation with a specified resource group and name. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsGet.json |
|
||||
| [customLocationsListByResourceGroupSample.ts][customlocationslistbyresourcegroupsample] | Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListByResourceGroup.json |
|
||||
| [customLocationsListBySubscriptionSample.ts][customlocationslistbysubscriptionsample] | Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListBySubscription.json |
|
||||
| [customLocationsListEnabledResourceTypesSample.ts][customlocationslistenabledresourcetypessample] | Gets the list of the Enabled Resource Types. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListEnabledResourceTypes.json |
|
||||
| [customLocationsListOperationsSample.ts][customlocationslistoperationssample] | Lists all available Custom Locations operations. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListOperations.json |
|
||||
| [customLocationsUpdateSample.ts][customlocationsupdatesample] | Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsPatch.json |
|
||||
| [resourceSyncRulesCreateOrUpdateSample.ts][resourcesyncrulescreateorupdatesample] | Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesCreate_Update.json |
|
||||
| [resourceSyncRulesDeleteSample.ts][resourcesyncrulesdeletesample] | Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesDelete.json |
|
||||
| [resourceSyncRulesGetSample.ts][resourcesyncrulesgetsample] | Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesGet.json |
|
||||
| [resourceSyncRulesListByCustomLocationIdSample.ts][resourcesyncruleslistbycustomlocationidsample] | Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesListByCustomLocationID.json |
|
||||
| [resourceSyncRulesUpdateSample.ts][resourcesyncrulesupdatesample] | Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name. x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesPatch.json |
|
||||
|
||||
## Prerequisites
|
||||
|
||||
The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/).
|
||||
|
||||
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
|
||||
|
||||
```bash
|
||||
npm install -g typescript
|
||||
```
|
||||
|
||||
You need [an Azure subscription][freesub] to run these sample programs.
|
||||
|
||||
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
|
||||
|
||||
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
|
||||
|
||||
## Setup
|
||||
|
||||
To run the samples using the published version of the package:
|
||||
|
||||
1. Install the dependencies using `npm`:
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
2. Compile the samples:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
|
||||
|
||||
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
|
||||
|
||||
```bash
|
||||
node dist/customLocationsCreateOrUpdateSample.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/customLocationsCreateOrUpdateSample.js
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
|
||||
|
||||
[customlocationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsCreateOrUpdateSample.ts
|
||||
[customlocationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsDeleteSample.ts
|
||||
[customlocationsfindtargetresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsFindTargetResourceGroupSample.ts
|
||||
[customlocationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsGetSample.ts
|
||||
[customlocationslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsListByResourceGroupSample.ts
|
||||
[customlocationslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsListBySubscriptionSample.ts
|
||||
[customlocationslistenabledresourcetypessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsListEnabledResourceTypesSample.ts
|
||||
[customlocationslistoperationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsListOperationsSample.ts
|
||||
[customlocationsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/customLocationsUpdateSample.ts
|
||||
[resourcesyncrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/resourceSyncRulesCreateOrUpdateSample.ts
|
||||
[resourcesyncrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/resourceSyncRulesDeleteSample.ts
|
||||
[resourcesyncrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/resourceSyncRulesGetSample.ts
|
||||
[resourcesyncruleslistbycustomlocationidsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/resourceSyncRulesListByCustomLocationIdSample.ts
|
||||
[resourcesyncrulesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/extendedlocation/arm-extendedlocation/samples/v1-beta/typescript/src/resourceSyncRulesUpdateSample.ts
|
||||
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation?view=azure-node-preview
|
||||
[freesub]: https://azure.microsoft.com/free/
|
||||
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation/README.md
|
||||
[typescript]: https://www.typescriptlang.org/docs/home.html
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"name": "@azure-samples/arm-extendedlocation-ts-beta",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": " client library samples for TypeScript (Beta)",
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"prebuild": "rimraf dist/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
|
||||
"directory": "sdk/extendedlocation/arm-extendedlocation"
|
||||
},
|
||||
"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/extendedlocation/arm-extendedlocation",
|
||||
"dependencies": {
|
||||
"@azure/arm-extendedlocation": "next",
|
||||
"dotenv": "latest",
|
||||
"@azure/identity": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.0",
|
||||
"typescript": "~4.4.0",
|
||||
"rimraf": "latest"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
# App registration secret for AAD authentication
|
||||
AZURE_CLIENT_SECRET=
|
||||
AZURE_CLIENT_ID=
|
||||
AZURE_TENANT_ID=
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
CustomLocation,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Custom Location in the specified Subscription and Resource Group
|
||||
*
|
||||
* @summary Creates or updates a Custom Location in the specified Subscription and Resource Group
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsCreate_Update.json
|
||||
*/
|
||||
async function createOrUpdateCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const parameters: CustomLocation = {
|
||||
authentication: { type: "KubeConfig", value: "<base64 KubeConfig>" },
|
||||
clusterExtensionIds: [
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedCluster/someCluster/Microsoft.KubernetesConfiguration/clusterExtensions/fooExtension"
|
||||
],
|
||||
displayName: "customLocationLocation01",
|
||||
hostResourceId:
|
||||
"/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup/providers/Microsoft.ContainerService/managedClusters/cluster01",
|
||||
identity: { type: "SystemAssigned" },
|
||||
location: "West US",
|
||||
namespace: "namespace01"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createOrUpdateCustomLocation().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id.
|
||||
*
|
||||
* @summary Deletes the Custom Location with the specified Resource Name, Resource Group, and Subscription Id.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsDelete.json
|
||||
*/
|
||||
async function deleteCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.beginDeleteAndWait(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteCustomLocation().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 {
|
||||
CustomLocationFindTargetResourceGroupProperties,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.
|
||||
*
|
||||
* @summary Returns the target resource group associated with the resource sync rules of the Custom Location that match the rules passed in with the Find Target Resource Group Request.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsFindTargetResourceGroup.json
|
||||
*/
|
||||
async function postCustomLocationFindTargetResourceGroup() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const parameters: CustomLocationFindTargetResourceGroupProperties = {
|
||||
labels: { key1: "value1", key2: "value2" }
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.findTargetResourceGroup(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
postCustomLocationFindTargetResourceGroup().catch(console.error);
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details of the customLocation with a specified resource group and name.
|
||||
*
|
||||
* @summary Gets the details of the customLocation with a specified resource group and name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsGet.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.get(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCustomLocation().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 { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location.
|
||||
*
|
||||
* @summary Gets a list of Custom Locations in the specified subscription and resource group. The operation returns properties of each Custom Location.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListByResourceGroup.json
|
||||
*/
|
||||
async function listCustomLocationsByResourceGroup() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listByResourceGroup(
|
||||
resourceGroupName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsByResourceGroup().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location
|
||||
*
|
||||
* @summary Gets a list of Custom Locations in the specified subscription. The operation returns properties of each Custom Location
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListBySubscription.json
|
||||
*/
|
||||
async function listCustomLocationsBySubscription() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listBySubscription()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsBySubscription().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 { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the list of the Enabled Resource Types.
|
||||
*
|
||||
* @summary Gets the list of the Enabled Resource Types.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListEnabledResourceTypes.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listEnabledResourceTypes(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
getCustomLocation().catch(console.error);
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Lists all available Custom Locations operations.
|
||||
*
|
||||
* @summary Lists all available Custom Locations operations.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsListOperations.json
|
||||
*/
|
||||
async function listCustomLocationsOperations() {
|
||||
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.customLocations.listOperations()) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listCustomLocationsOperations().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 {
|
||||
CustomLocationsUpdateOptionalParams,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription.
|
||||
*
|
||||
* @summary Updates a Custom Location with the specified Resource Name in the specified Resource Group and Subscription.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/CustomLocationsPatch.json
|
||||
*/
|
||||
async function updateCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const identity = { type: "SystemAssigned" };
|
||||
const tags = { archv3: "", tier: "testing" };
|
||||
const options: CustomLocationsUpdateOptionalParams = { identity, tags };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.customLocations.update(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateCustomLocation().catch(console.error);
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ResourceSyncRule,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group
|
||||
*
|
||||
* @summary Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesCreate_Update.json
|
||||
*/
|
||||
async function createOrUpdateResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const parameters: ResourceSyncRule = {
|
||||
location: "West US",
|
||||
priority: 999,
|
||||
selector: {
|
||||
matchExpressions: [{ key: "key4", operator: "In", values: ["value4"] }],
|
||||
matchLabels: { key1: "value1" }
|
||||
},
|
||||
targetResourceGroup:
|
||||
"/subscriptions/11111111-2222-3333-4444-555555555555/resourceGroups/testresourcegroup"
|
||||
};
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.beginCreateOrUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
parameters
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
createOrUpdateResourceSyncRule().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
|
||||
*
|
||||
* @summary Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name, Resource Group, and Subscription Id.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesDelete.json
|
||||
*/
|
||||
async function deleteResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.delete(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
deleteResourceSyncRule().catch(console.error);
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
|
||||
*
|
||||
* @summary Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location resource name and Resource Sync Rule name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesGet.json
|
||||
*/
|
||||
async function getCustomLocation() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.get(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
getCustomLocation().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 { CustomLocationsManagementClient } from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
|
||||
*
|
||||
* @summary Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each Resource Sync Rule
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesListByCustomLocationID.json
|
||||
*/
|
||||
async function listResourceSyncRulesBySubscription() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const resArray = new Array();
|
||||
for await (let item of client.resourceSyncRules.listByCustomLocationID(
|
||||
resourceGroupName,
|
||||
resourceName
|
||||
)) {
|
||||
resArray.push(item);
|
||||
}
|
||||
console.log(resArray);
|
||||
}
|
||||
|
||||
listResourceSyncRulesBySubscription().catch(console.error);
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import {
|
||||
ResourceSyncRulesUpdateOptionalParams,
|
||||
CustomLocationsManagementClient
|
||||
} from "@azure/arm-extendedlocation";
|
||||
import { DefaultAzureCredential } from "@azure/identity";
|
||||
|
||||
/**
|
||||
* This sample demonstrates how to Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.
|
||||
*
|
||||
* @summary Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group, Subscription and Custom Location name.
|
||||
* x-ms-original-file: specification/extendedlocation/resource-manager/Microsoft.ExtendedLocation/preview/2021-08-31-preview/examples/ResourceSyncRulesPatch.json
|
||||
*/
|
||||
async function updateResourceSyncRule() {
|
||||
const subscriptionId = "11111111-2222-3333-4444-555555555555";
|
||||
const resourceGroupName = "testresourcegroup";
|
||||
const resourceName = "customLocation01";
|
||||
const childResourceName = "resourceSyncRule01";
|
||||
const tags = { tier: "testing" };
|
||||
const options: ResourceSyncRulesUpdateOptionalParams = { tags };
|
||||
const credential = new DefaultAzureCredential();
|
||||
const client = new CustomLocationsManagementClient(
|
||||
credential,
|
||||
subscriptionId
|
||||
);
|
||||
const result = await client.resourceSyncRules.beginUpdateAndWait(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
options
|
||||
);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
updateResourceSyncRule().catch(console.error);
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2018",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": [
|
||||
"src/**.ts"
|
||||
]
|
||||
}
|
|
@ -6,13 +6,23 @@
|
|||
* 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 { CustomLocationsImpl } from "./operations";
|
||||
import { CustomLocations } from "./operationsInterfaces";
|
||||
import { CustomLocationsManagementClientContext } from "./customLocationsManagementClientContext";
|
||||
import { CustomLocationsImpl, ResourceSyncRulesImpl } from "./operations";
|
||||
import { CustomLocations, ResourceSyncRules } from "./operationsInterfaces";
|
||||
import { CustomLocationsManagementClientOptionalParams } from "./models";
|
||||
|
||||
export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
|
||||
export class CustomLocationsManagementClient extends coreClient.ServiceClient {
|
||||
$host: string;
|
||||
apiVersion: string;
|
||||
subscriptionId: string;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the CustomLocationsManagementClient class.
|
||||
* @param credentials Subscription credentials which uniquely identify client subscription.
|
||||
|
@ -24,9 +34,103 @@ export class CustomLocationsManagementClient extends CustomLocationsManagementCl
|
|||
subscriptionId: string,
|
||||
options?: CustomLocationsManagementClientOptionalParams
|
||||
) {
|
||||
super(credentials, subscriptionId, options);
|
||||
if (credentials === undefined) {
|
||||
throw new Error("'credentials' cannot be null");
|
||||
}
|
||||
if (subscriptionId === undefined) {
|
||||
throw new Error("'subscriptionId' cannot be null");
|
||||
}
|
||||
|
||||
// Initializing default values for options
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
const defaults: CustomLocationsManagementClientOptionalParams = {
|
||||
requestContentType: "application/json; charset=utf-8",
|
||||
credential: credentials
|
||||
};
|
||||
|
||||
const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.2`;
|
||||
const userAgentPrefix =
|
||||
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
||||
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
||||
: `${packageDetails}`;
|
||||
|
||||
if (!options.credentialScopes) {
|
||||
options.credentialScopes = ["https://management.azure.com/.default"];
|
||||
}
|
||||
const optionsWithDefaults = {
|
||||
...defaults,
|
||||
...options,
|
||||
userAgentOptions: {
|
||||
userAgentPrefix
|
||||
},
|
||||
baseUri:
|
||||
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
||||
};
|
||||
super(optionsWithDefaults);
|
||||
|
||||
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
||||
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
||||
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
||||
(pipelinePolicy) =>
|
||||
pipelinePolicy.name ===
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
);
|
||||
if (!bearerTokenAuthenticationPolicyFound) {
|
||||
this.pipeline.removePolicy({
|
||||
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
||||
});
|
||||
this.pipeline.addPolicy(
|
||||
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
||||
scopes: `${optionsWithDefaults.baseUri}/.default`,
|
||||
challengeCallbacks: {
|
||||
authorizeRequestOnChallenge:
|
||||
coreClient.authorizeRequestOnClaimChallenge
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
// Parameter assignments
|
||||
this.subscriptionId = subscriptionId;
|
||||
|
||||
// Assigning values to Constant parameters
|
||||
this.$host = options.$host || "https://management.azure.com";
|
||||
this.apiVersion = options.apiVersion || "2021-08-31-preview";
|
||||
this.customLocations = new CustomLocationsImpl(this);
|
||||
this.resourceSyncRules = new ResourceSyncRulesImpl(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);
|
||||
}
|
||||
|
||||
customLocations: CustomLocations;
|
||||
resourceSyncRules: ResourceSyncRules;
|
||||
}
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 coreAuth from "@azure/core-auth";
|
||||
import { CustomLocationsManagementClientOptionalParams } from "./models";
|
||||
|
||||
export class CustomLocationsManagementClientContext extends coreClient.ServiceClient {
|
||||
$host: string;
|
||||
apiVersion: string;
|
||||
subscriptionId: string;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the CustomLocationsManagementClientContext class.
|
||||
* @param credentials Subscription credentials which uniquely identify client subscription.
|
||||
* @param subscriptionId The ID of the target subscription.
|
||||
* @param options The parameter options
|
||||
*/
|
||||
constructor(
|
||||
credentials: coreAuth.TokenCredential,
|
||||
subscriptionId: string,
|
||||
options?: CustomLocationsManagementClientOptionalParams
|
||||
) {
|
||||
if (credentials === undefined) {
|
||||
throw new Error("'credentials' cannot be null");
|
||||
}
|
||||
if (subscriptionId === undefined) {
|
||||
throw new Error("'subscriptionId' cannot be null");
|
||||
}
|
||||
|
||||
// Initializing default values for options
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
const defaults: CustomLocationsManagementClientOptionalParams = {
|
||||
requestContentType: "application/json; charset=utf-8",
|
||||
credential: credentials
|
||||
};
|
||||
|
||||
const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.1`;
|
||||
const userAgentPrefix =
|
||||
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
||||
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
||||
: `${packageDetails}`;
|
||||
|
||||
if (!options.credentialScopes) {
|
||||
options.credentialScopes = ["https://management.azure.com/.default"];
|
||||
}
|
||||
const optionsWithDefaults = {
|
||||
...defaults,
|
||||
...options,
|
||||
userAgentOptions: {
|
||||
userAgentPrefix
|
||||
},
|
||||
baseUri: options.endpoint || "https://management.azure.com"
|
||||
};
|
||||
super(optionsWithDefaults);
|
||||
// Parameter assignments
|
||||
this.subscriptionId = subscriptionId;
|
||||
|
||||
// Assigning values to Constant parameters
|
||||
this.$host = options.$host || "https://management.azure.com";
|
||||
this.apiVersion = options.apiVersion || "2021-08-15";
|
||||
}
|
||||
}
|
|
@ -9,5 +9,4 @@
|
|||
/// <reference lib="esnext.asynciterable" />
|
||||
export * from "./models";
|
||||
export { CustomLocationsManagementClient } from "./customLocationsManagementClient";
|
||||
export { CustomLocationsManagementClientContext } from "./customLocationsManagementClientContext";
|
||||
export * from "./operationsInterfaces";
|
||||
|
|
|
@ -118,25 +118,6 @@ export interface CustomLocationListResult {
|
|||
readonly value?: CustomLocation[];
|
||||
}
|
||||
|
||||
/** Common fields that are returned in the response for all Azure Resource Manager resources */
|
||||
export interface Resource {
|
||||
/**
|
||||
* Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly id?: string;
|
||||
/**
|
||||
* The name of the resource
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/**
|
||||
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
/** Identity for the resource. */
|
||||
export interface Identity {
|
||||
/**
|
||||
|
@ -177,6 +158,25 @@ export interface SystemData {
|
|||
lastModifiedAt?: Date;
|
||||
}
|
||||
|
||||
/** Common fields that are returned in the response for all Azure Resource Manager resources */
|
||||
export interface Resource {
|
||||
/**
|
||||
* Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly id?: string;
|
||||
/**
|
||||
* The name of the resource
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly name?: string;
|
||||
/**
|
||||
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly type?: string;
|
||||
}
|
||||
|
||||
/** The Custom Locations patchable resource definition. */
|
||||
export interface PatchableCustomLocations {
|
||||
/** Identity for the resource. */
|
||||
|
@ -223,19 +223,88 @@ export interface EnabledResourceTypePropertiesTypesMetadataItem {
|
|||
resourceType?: string;
|
||||
}
|
||||
|
||||
/** The Find Target Resource Group operation request. */
|
||||
export interface CustomLocationFindTargetResourceGroupProperties {
|
||||
/** Labels of the custom resource, this is a map of {key,value} pairs. */
|
||||
labels?: { [propertyName: string]: string };
|
||||
}
|
||||
|
||||
/** The Find Target Resource Group operation response. */
|
||||
export interface CustomLocationFindTargetResourceGroupResult {
|
||||
/**
|
||||
* The matching resource sync rule is the particular resource sync rule that matched the match expressions and labels and had lowest priority. This is the rule responsible for mapping the target resource to the target resource group.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly matchedResourceSyncRule?: string;
|
||||
/**
|
||||
* The target resource group of matching resource sync rule. The labels from the request will be used to find out matching resource sync rule against the selector property of the resource sync rule. The one with highest priority will be returned if there are multiple matching rules.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly targetResourceGroup?: string;
|
||||
}
|
||||
|
||||
/** The List Resource Sync Rules operation response. */
|
||||
export interface ResourceSyncRuleListResult {
|
||||
/**
|
||||
* The URL to use for getting the next set of results.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly nextLink?: string;
|
||||
/**
|
||||
* The list of Resource Sync Rules.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly value?: ResourceSyncRule[];
|
||||
}
|
||||
|
||||
/** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */
|
||||
export interface ResourceSyncRulePropertiesSelector {
|
||||
/** MatchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. */
|
||||
matchExpressions?: MatchExpressionsProperties[];
|
||||
/** MatchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. */
|
||||
matchLabels?: { [propertyName: string]: string };
|
||||
}
|
||||
|
||||
/** Resource Sync Rules matchExpression property definition. */
|
||||
export interface MatchExpressionsProperties {
|
||||
/** Key is the label key that the selector applies to. */
|
||||
key?: string;
|
||||
/** The Operator field represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. */
|
||||
operator?: string;
|
||||
/** The label value */
|
||||
values?: string[];
|
||||
}
|
||||
|
||||
/** The Resource Sync Rules patchable resource definition. */
|
||||
export interface PatchableResourceSyncRule {
|
||||
/** Resource tags */
|
||||
tags?: { [propertyName: string]: string };
|
||||
/** Priority represents a priority of the Resource Sync Rule */
|
||||
priority?: number;
|
||||
/**
|
||||
* Provisioning State for the Resource Sync Rule.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provisioningState?: string;
|
||||
/** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */
|
||||
selector?: ResourceSyncRulePropertiesSelector;
|
||||
/** For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. */
|
||||
targetResourceGroup?: string;
|
||||
}
|
||||
|
||||
/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */
|
||||
export type TrackedResource = Resource & {
|
||||
export interface TrackedResource extends Resource {
|
||||
/** Resource tags. */
|
||||
tags?: { [propertyName: string]: string };
|
||||
/** The geo-location where the resource lives */
|
||||
location: string;
|
||||
};
|
||||
}
|
||||
|
||||
/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */
|
||||
export type ProxyResource = Resource & {};
|
||||
export interface ProxyResource extends Resource {}
|
||||
|
||||
/** Custom Locations definition. */
|
||||
export type CustomLocation = TrackedResource & {
|
||||
export interface CustomLocation extends TrackedResource {
|
||||
/** Identity for the resource. */
|
||||
identity?: Identity;
|
||||
/**
|
||||
|
@ -257,10 +326,30 @@ export type CustomLocation = TrackedResource & {
|
|||
namespace?: string;
|
||||
/** Provisioning State for the Custom Location. */
|
||||
provisioningState?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/** Resource Sync Rules definition. */
|
||||
export interface ResourceSyncRule extends TrackedResource {
|
||||
/**
|
||||
* Metadata pertaining to creation and last modification of the resource
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly systemData?: SystemData;
|
||||
/** Priority represents a priority of the Resource Sync Rule */
|
||||
priority?: number;
|
||||
/**
|
||||
* Provisioning State for the Resource Sync Rule.
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
*/
|
||||
readonly provisioningState?: string;
|
||||
/** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */
|
||||
selector?: ResourceSyncRulePropertiesSelector;
|
||||
/** For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. */
|
||||
targetResourceGroup?: string;
|
||||
}
|
||||
|
||||
/** EnabledResourceType definition. */
|
||||
export type EnabledResourceType = ProxyResource & {
|
||||
export interface EnabledResourceType extends ProxyResource {
|
||||
/**
|
||||
* Metadata pertaining to creation and last modification of the resource
|
||||
* NOTE: This property will not be serialized. It can only be populated by the server.
|
||||
|
@ -272,11 +361,13 @@ export type EnabledResourceType = ProxyResource & {
|
|||
extensionType?: string;
|
||||
/** Metadata of the Resource Type */
|
||||
typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[];
|
||||
};
|
||||
}
|
||||
|
||||
/** Known values of {@link ResourceIdentityType} that the service accepts. */
|
||||
export enum KnownResourceIdentityType {
|
||||
/** SystemAssigned */
|
||||
SystemAssigned = "SystemAssigned",
|
||||
/** None */
|
||||
None = "None"
|
||||
}
|
||||
|
||||
|
@ -292,6 +383,7 @@ export type ResourceIdentityType = string;
|
|||
|
||||
/** Known values of {@link HostType} that the service accepts. */
|
||||
export enum KnownHostType {
|
||||
/** Kubernetes */
|
||||
Kubernetes = "Kubernetes"
|
||||
}
|
||||
|
||||
|
@ -306,9 +398,13 @@ export type HostType = 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"
|
||||
}
|
||||
|
||||
|
@ -406,6 +502,13 @@ export interface CustomLocationsListEnabledResourceTypesOptionalParams
|
|||
/** Contains response data for the listEnabledResourceTypes operation. */
|
||||
export type CustomLocationsListEnabledResourceTypesResponse = EnabledResourceTypesListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CustomLocationsFindTargetResourceGroupOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the findTargetResourceGroup operation. */
|
||||
export type CustomLocationsFindTargetResourceGroupResponse = CustomLocationFindTargetResourceGroupResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CustomLocationsListOperationsNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
@ -434,6 +537,63 @@ export interface CustomLocationsListEnabledResourceTypesNextOptionalParams
|
|||
/** Contains response data for the listEnabledResourceTypesNext operation. */
|
||||
export type CustomLocationsListEnabledResourceTypesNextResponse = EnabledResourceTypesListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ResourceSyncRulesListByCustomLocationIDOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByCustomLocationID operation. */
|
||||
export type ResourceSyncRulesListByCustomLocationIDResponse = ResourceSyncRuleListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ResourceSyncRulesGetOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the get operation. */
|
||||
export type ResourceSyncRulesGetResponse = ResourceSyncRule;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ResourceSyncRulesCreateOrUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Contains response data for the createOrUpdate operation. */
|
||||
export type ResourceSyncRulesCreateOrUpdateResponse = ResourceSyncRule;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ResourceSyncRulesDeleteOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ResourceSyncRulesUpdateOptionalParams
|
||||
extends coreClient.OperationOptions {
|
||||
/** Resource tags */
|
||||
tags?: { [propertyName: string]: string };
|
||||
/** Priority represents a priority of the Resource Sync Rule */
|
||||
priority?: number;
|
||||
/** A label selector is composed of two parts, matchLabels and matchExpressions. The first part, matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is 'key', the operator is 'In', and the values array contains only 'value'. The second part, matchExpressions is a list of resource selector requirements. Valid operators include In, NotIn, Exists, and DoesNotExist. The values set must be non-empty in the case of In and NotIn. The values set must be empty in the case of Exists and DoesNotExist. All of the requirements, from both matchLabels and matchExpressions must all be satisfied in order to match. */
|
||||
selector?: ResourceSyncRulePropertiesSelector;
|
||||
/** For an unmapped custom resource, its labels will be used to find matching resource sync rules. If this resource sync rule is one of the matching rules with highest priority, then the unmapped custom resource will be projected to the target resource group associated with this resource sync rule. The user creating this resource sync rule should have write permissions on the target resource group and this write permission will be validated when creating the resource sync rule. */
|
||||
targetResourceGroup?: string;
|
||||
/** Delay to wait until next poll, in milliseconds. */
|
||||
updateIntervalInMs?: number;
|
||||
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
||||
resumeFrom?: string;
|
||||
}
|
||||
|
||||
/** Contains response data for the update operation. */
|
||||
export type ResourceSyncRulesUpdateResponse = ResourceSyncRule;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface ResourceSyncRulesListByCustomLocationIDNextOptionalParams
|
||||
extends coreClient.OperationOptions {}
|
||||
|
||||
/** Contains response data for the listByCustomLocationIDNext operation. */
|
||||
export type ResourceSyncRulesListByCustomLocationIDNextResponse = ResourceSyncRuleListResult;
|
||||
|
||||
/** Optional parameters. */
|
||||
export interface CustomLocationsManagementClientOptionalParams
|
||||
extends coreClient.ServiceClientOptions {
|
||||
|
|
|
@ -219,36 +219,6 @@ export const CustomLocationListResult: coreClient.CompositeMapper = {
|
|||
}
|
||||
};
|
||||
|
||||
export const Resource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Resource",
|
||||
modelProperties: {
|
||||
id: {
|
||||
serializedName: "id",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
name: {
|
||||
serializedName: "name",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
type: {
|
||||
serializedName: "type",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const Identity: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
|
@ -344,6 +314,36 @@ export const SystemData: coreClient.CompositeMapper = {
|
|||
}
|
||||
};
|
||||
|
||||
export const Resource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "Resource",
|
||||
modelProperties: {
|
||||
id: {
|
||||
serializedName: "id",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
name: {
|
||||
serializedName: "name",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
type: {
|
||||
serializedName: "type",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const PatchableCustomLocations: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
|
@ -471,6 +471,176 @@ export const EnabledResourceTypePropertiesTypesMetadataItem: coreClient.Composit
|
|||
}
|
||||
};
|
||||
|
||||
export const CustomLocationFindTargetResourceGroupProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "CustomLocationFindTargetResourceGroupProperties",
|
||||
modelProperties: {
|
||||
labels: {
|
||||
serializedName: "labels",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const CustomLocationFindTargetResourceGroupResult: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "CustomLocationFindTargetResourceGroupResult",
|
||||
modelProperties: {
|
||||
matchedResourceSyncRule: {
|
||||
serializedName: "matchedResourceSyncRule",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
targetResourceGroup: {
|
||||
serializedName: "targetResourceGroup",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ResourceSyncRuleListResult: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSyncRuleListResult",
|
||||
modelProperties: {
|
||||
nextLink: {
|
||||
serializedName: "nextLink",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
value: {
|
||||
serializedName: "value",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSyncRule"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const ResourceSyncRulePropertiesSelector: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSyncRulePropertiesSelector",
|
||||
modelProperties: {
|
||||
matchExpressions: {
|
||||
serializedName: "matchExpressions",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "MatchExpressionsProperties"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
matchLabels: {
|
||||
serializedName: "matchLabels",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const MatchExpressionsProperties: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "MatchExpressionsProperties",
|
||||
modelProperties: {
|
||||
key: {
|
||||
serializedName: "key",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
operator: {
|
||||
serializedName: "operator",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
values: {
|
||||
serializedName: "values",
|
||||
type: {
|
||||
name: "Sequence",
|
||||
element: {
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const PatchableResourceSyncRule: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "PatchableResourceSyncRule",
|
||||
modelProperties: {
|
||||
tags: {
|
||||
serializedName: "tags",
|
||||
type: {
|
||||
name: "Dictionary",
|
||||
value: { type: { name: "String" } }
|
||||
}
|
||||
},
|
||||
priority: {
|
||||
serializedName: "properties.priority",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
},
|
||||
provisioningState: {
|
||||
serializedName: "properties.provisioningState",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
selector: {
|
||||
serializedName: "properties.selector",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSyncRulePropertiesSelector"
|
||||
}
|
||||
},
|
||||
targetResourceGroup: {
|
||||
serializedName: "properties.targetResourceGroup",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const TrackedResource: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
|
@ -577,6 +747,49 @@ export const CustomLocation: coreClient.CompositeMapper = {
|
|||
}
|
||||
};
|
||||
|
||||
export const ResourceSyncRule: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSyncRule",
|
||||
modelProperties: {
|
||||
...TrackedResource.type.modelProperties,
|
||||
systemData: {
|
||||
serializedName: "systemData",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "SystemData"
|
||||
}
|
||||
},
|
||||
priority: {
|
||||
serializedName: "properties.priority",
|
||||
type: {
|
||||
name: "Number"
|
||||
}
|
||||
},
|
||||
provisioningState: {
|
||||
serializedName: "properties.provisioningState",
|
||||
readOnly: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
},
|
||||
selector: {
|
||||
serializedName: "properties.selector",
|
||||
type: {
|
||||
name: "Composite",
|
||||
className: "ResourceSyncRulePropertiesSelector"
|
||||
}
|
||||
},
|
||||
targetResourceGroup: {
|
||||
serializedName: "properties.targetResourceGroup",
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const EnabledResourceType: coreClient.CompositeMapper = {
|
||||
type: {
|
||||
name: "Composite",
|
||||
|
|
|
@ -13,7 +13,10 @@ import {
|
|||
} from "@azure/core-client";
|
||||
import {
|
||||
CustomLocation as CustomLocationMapper,
|
||||
PatchableCustomLocations as PatchableCustomLocationsMapper
|
||||
PatchableCustomLocations as PatchableCustomLocationsMapper,
|
||||
CustomLocationFindTargetResourceGroupProperties as CustomLocationFindTargetResourceGroupPropertiesMapper,
|
||||
ResourceSyncRule as ResourceSyncRuleMapper,
|
||||
PatchableResourceSyncRule as PatchableResourceSyncRuleMapper
|
||||
} from "../models/mappers";
|
||||
|
||||
export const accept: OperationParameter = {
|
||||
|
@ -43,7 +46,7 @@ export const $host: OperationURLParameter = {
|
|||
export const apiVersion: OperationQueryParameter = {
|
||||
parameterPath: "apiVersion",
|
||||
mapper: {
|
||||
defaultValue: "2021-08-15",
|
||||
defaultValue: "2021-08-31-preview",
|
||||
isConstant: true,
|
||||
serializedName: "api-version",
|
||||
type: {
|
||||
|
@ -161,6 +164,11 @@ export const provisioningState: OperationParameter = {
|
|||
mapper: PatchableCustomLocationsMapper
|
||||
};
|
||||
|
||||
export const parameters2: OperationParameter = {
|
||||
parameterPath: "parameters",
|
||||
mapper: CustomLocationFindTargetResourceGroupPropertiesMapper
|
||||
};
|
||||
|
||||
export const nextLink: OperationURLParameter = {
|
||||
parameterPath: "nextLink",
|
||||
mapper: {
|
||||
|
@ -172,3 +180,46 @@ export const nextLink: OperationURLParameter = {
|
|||
},
|
||||
skipEncoding: true
|
||||
};
|
||||
|
||||
export const childResourceName: OperationURLParameter = {
|
||||
parameterPath: "childResourceName",
|
||||
mapper: {
|
||||
constraints: {
|
||||
Pattern: new RegExp(
|
||||
"^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"
|
||||
),
|
||||
MaxLength: 63,
|
||||
MinLength: 1
|
||||
},
|
||||
serializedName: "childResourceName",
|
||||
required: true,
|
||||
type: {
|
||||
name: "String"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const parameters3: OperationParameter = {
|
||||
parameterPath: "parameters",
|
||||
mapper: ResourceSyncRuleMapper
|
||||
};
|
||||
|
||||
export const tags1: OperationParameter = {
|
||||
parameterPath: ["options", "tags"],
|
||||
mapper: PatchableResourceSyncRuleMapper
|
||||
};
|
||||
|
||||
export const priority: OperationParameter = {
|
||||
parameterPath: ["options", "priority"],
|
||||
mapper: PatchableResourceSyncRuleMapper
|
||||
};
|
||||
|
||||
export const selector: OperationParameter = {
|
||||
parameterPath: ["options", "selector"],
|
||||
mapper: PatchableResourceSyncRuleMapper
|
||||
};
|
||||
|
||||
export const targetResourceGroup: OperationParameter = {
|
||||
parameterPath: ["options", "targetResourceGroup"],
|
||||
mapper: PatchableResourceSyncRuleMapper
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@ import { CustomLocations } from "../operationsInterfaces";
|
|||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { CustomLocationsManagementClientContext } from "../customLocationsManagementClientContext";
|
||||
import { CustomLocationsManagementClient } from "../customLocationsManagementClient";
|
||||
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
||||
import { LroImpl } from "../lroImpl";
|
||||
import {
|
||||
|
@ -37,6 +37,9 @@ import {
|
|||
CustomLocationsUpdateOptionalParams,
|
||||
CustomLocationsUpdateResponse,
|
||||
CustomLocationsListEnabledResourceTypesResponse,
|
||||
CustomLocationFindTargetResourceGroupProperties,
|
||||
CustomLocationsFindTargetResourceGroupOptionalParams,
|
||||
CustomLocationsFindTargetResourceGroupResponse,
|
||||
CustomLocationsListOperationsNextResponse,
|
||||
CustomLocationsListBySubscriptionNextResponse,
|
||||
CustomLocationsListByResourceGroupNextResponse,
|
||||
|
@ -46,13 +49,13 @@ import {
|
|||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing CustomLocations operations. */
|
||||
export class CustomLocationsImpl implements CustomLocations {
|
||||
private readonly client: CustomLocationsManagementClientContext;
|
||||
private readonly client: CustomLocationsManagementClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class CustomLocations class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: CustomLocationsManagementClientContext) {
|
||||
constructor(client: CustomLocationsManagementClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
@ -388,11 +391,13 @@ export class CustomLocationsImpl implements CustomLocations {
|
|||
{ resourceGroupName, resourceName, parameters, options },
|
||||
createOrUpdateOperationSpec
|
||||
);
|
||||
return new LroEngine(lro, {
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
lroResourceLocationConfig: "azure-async-operation"
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -472,11 +477,13 @@ export class CustomLocationsImpl implements CustomLocations {
|
|||
{ resourceGroupName, resourceName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
return new LroEngine(lro, {
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
lroResourceLocationConfig: "azure-async-operation"
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -533,6 +540,26 @@ export class CustomLocationsImpl implements CustomLocations {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the target resource group associated with the resource sync rules of the Custom Location
|
||||
* that match the rules passed in with the Find Target Resource Group Request.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param parameters Parameters of the find target resource group request.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
findTargetResourceGroup(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
parameters: CustomLocationFindTargetResourceGroupProperties,
|
||||
options?: CustomLocationsFindTargetResourceGroupOptionalParams
|
||||
): Promise<CustomLocationsFindTargetResourceGroupResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, resourceName, parameters, options },
|
||||
findTargetResourceGroupOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ListOperationsNext
|
||||
* @param nextLink The nextLink from the previous successful call to the ListOperations method.
|
||||
|
@ -794,6 +821,31 @@ const listEnabledResourceTypesOperationSpec: coreClient.OperationSpec = {
|
|||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const findTargetResourceGroupOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/findTargetResourceGroup",
|
||||
httpMethod: "POST",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.CustomLocationFindTargetResourceGroupResult
|
||||
},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.parameters2,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.resourceName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const listOperationsNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
|
|
|
@ -7,3 +7,4 @@
|
|||
*/
|
||||
|
||||
export * from "./customLocations";
|
||||
export * from "./resourceSyncRules";
|
||||
|
|
|
@ -0,0 +1,562 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the 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 { ResourceSyncRules } from "../operationsInterfaces";
|
||||
import * as coreClient from "@azure/core-client";
|
||||
import * as Mappers from "../models/mappers";
|
||||
import * as Parameters from "../models/parameters";
|
||||
import { CustomLocationsManagementClient } from "../customLocationsManagementClient";
|
||||
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
|
||||
import { LroImpl } from "../lroImpl";
|
||||
import {
|
||||
ResourceSyncRule,
|
||||
ResourceSyncRulesListByCustomLocationIDNextOptionalParams,
|
||||
ResourceSyncRulesListByCustomLocationIDOptionalParams,
|
||||
ResourceSyncRulesListByCustomLocationIDResponse,
|
||||
ResourceSyncRulesGetOptionalParams,
|
||||
ResourceSyncRulesGetResponse,
|
||||
ResourceSyncRulesCreateOrUpdateOptionalParams,
|
||||
ResourceSyncRulesCreateOrUpdateResponse,
|
||||
ResourceSyncRulesDeleteOptionalParams,
|
||||
ResourceSyncRulesUpdateOptionalParams,
|
||||
ResourceSyncRulesUpdateResponse,
|
||||
ResourceSyncRulesListByCustomLocationIDNextResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Class containing ResourceSyncRules operations. */
|
||||
export class ResourceSyncRulesImpl implements ResourceSyncRules {
|
||||
private readonly client: CustomLocationsManagementClient;
|
||||
|
||||
/**
|
||||
* Initialize a new instance of the class ResourceSyncRules class.
|
||||
* @param client Reference to the service client
|
||||
*/
|
||||
constructor(client: CustomLocationsManagementClient) {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
|
||||
* of each Resource Sync Rule
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
public listByCustomLocationID(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
|
||||
): PagedAsyncIterableIterator<ResourceSyncRule> {
|
||||
const iter = this.listByCustomLocationIDPagingAll(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
options
|
||||
);
|
||||
return {
|
||||
next() {
|
||||
return iter.next();
|
||||
},
|
||||
[Symbol.asyncIterator]() {
|
||||
return this;
|
||||
},
|
||||
byPage: () => {
|
||||
return this.listByCustomLocationIDPagingPage(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
options
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private async *listByCustomLocationIDPagingPage(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
|
||||
): AsyncIterableIterator<ResourceSyncRule[]> {
|
||||
let result = await this._listByCustomLocationID(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
options
|
||||
);
|
||||
yield result.value || [];
|
||||
let continuationToken = result.nextLink;
|
||||
while (continuationToken) {
|
||||
result = await this._listByCustomLocationIDNext(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
continuationToken,
|
||||
options
|
||||
);
|
||||
continuationToken = result.nextLink;
|
||||
yield result.value || [];
|
||||
}
|
||||
}
|
||||
|
||||
private async *listByCustomLocationIDPagingAll(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
|
||||
): AsyncIterableIterator<ResourceSyncRule> {
|
||||
for await (const page of this.listByCustomLocationIDPagingPage(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
options
|
||||
)) {
|
||||
yield* page;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
|
||||
* of each Resource Sync Rule
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByCustomLocationID(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
|
||||
): Promise<ResourceSyncRulesListByCustomLocationIDResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, resourceName, options },
|
||||
listByCustomLocationIDOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom
|
||||
* Location resource name and Resource Sync Rule name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesGetOptionalParams
|
||||
): Promise<ResourceSyncRulesGetResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, resourceName, childResourceName, options },
|
||||
getOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
|
||||
* Group
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param parameters Parameters supplied to create or update a Resource Sync Rule.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateOrUpdate(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
parameters: ResourceSyncRule,
|
||||
options?: ResourceSyncRulesCreateOrUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<ResourceSyncRulesCreateOrUpdateResponse>,
|
||||
ResourceSyncRulesCreateOrUpdateResponse
|
||||
>
|
||||
> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<ResourceSyncRulesCreateOrUpdateResponse> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
parameters,
|
||||
options
|
||||
},
|
||||
createOrUpdateOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
lroResourceLocationConfig: "azure-async-operation"
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
|
||||
* Group
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param parameters Parameters supplied to create or update a Resource Sync Rule.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginCreateOrUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
parameters: ResourceSyncRule,
|
||||
options?: ResourceSyncRulesCreateOrUpdateOptionalParams
|
||||
): Promise<ResourceSyncRulesCreateOrUpdateResponse> {
|
||||
const poller = await this.beginCreateOrUpdate(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
parameters,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource
|
||||
* Name, Resource Group, and Subscription Id.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesDeleteOptionalParams
|
||||
): Promise<void> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, resourceName, childResourceName, options },
|
||||
deleteOperationSpec
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
|
||||
* Group, Subscription and Custom Location name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginUpdate(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<ResourceSyncRulesUpdateResponse>,
|
||||
ResourceSyncRulesUpdateResponse
|
||||
>
|
||||
> {
|
||||
const directSendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
): Promise<ResourceSyncRulesUpdateResponse> => {
|
||||
return this.client.sendOperationRequest(args, spec);
|
||||
};
|
||||
const sendOperation = async (
|
||||
args: coreClient.OperationArguments,
|
||||
spec: coreClient.OperationSpec
|
||||
) => {
|
||||
let currentRawResponse:
|
||||
| coreClient.FullOperationResponse
|
||||
| undefined = undefined;
|
||||
const providedCallback = args.options?.onResponse;
|
||||
const callback: coreClient.RawResponseCallback = (
|
||||
rawResponse: coreClient.FullOperationResponse,
|
||||
flatResponse: unknown
|
||||
) => {
|
||||
currentRawResponse = rawResponse;
|
||||
providedCallback?.(rawResponse, flatResponse);
|
||||
};
|
||||
const updatedArgs = {
|
||||
...args,
|
||||
options: {
|
||||
...args.options,
|
||||
onResponse: callback
|
||||
}
|
||||
};
|
||||
const flatResponse = await directSendOperation(updatedArgs, spec);
|
||||
return {
|
||||
flatResponse,
|
||||
rawResponse: {
|
||||
statusCode: currentRawResponse!.status,
|
||||
body: currentRawResponse!.parsedBody,
|
||||
headers: currentRawResponse!.headers.toJSON()
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const lro = new LroImpl(
|
||||
sendOperation,
|
||||
{ resourceGroupName, resourceName, childResourceName, options },
|
||||
updateOperationSpec
|
||||
);
|
||||
const poller = new LroEngine(lro, {
|
||||
resumeFrom: options?.resumeFrom,
|
||||
intervalInMs: options?.updateIntervalInMs,
|
||||
lroResourceLocationConfig: "azure-async-operation"
|
||||
});
|
||||
await poller.poll();
|
||||
return poller;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
|
||||
* Group, Subscription and Custom Location name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
async beginUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesUpdateOptionalParams
|
||||
): Promise<ResourceSyncRulesUpdateResponse> {
|
||||
const poller = await this.beginUpdate(
|
||||
resourceGroupName,
|
||||
resourceName,
|
||||
childResourceName,
|
||||
options
|
||||
);
|
||||
return poller.pollUntilDone();
|
||||
}
|
||||
|
||||
/**
|
||||
* ListByCustomLocationIDNext
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param nextLink The nextLink from the previous successful call to the ListByCustomLocationID method.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
private _listByCustomLocationIDNext(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
nextLink: string,
|
||||
options?: ResourceSyncRulesListByCustomLocationIDNextOptionalParams
|
||||
): Promise<ResourceSyncRulesListByCustomLocationIDNextResponse> {
|
||||
return this.client.sendOperationRequest(
|
||||
{ resourceGroupName, resourceName, nextLink, options },
|
||||
listByCustomLocationIDNextOperationSpec
|
||||
);
|
||||
}
|
||||
}
|
||||
// Operation Specifications
|
||||
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
||||
|
||||
const listByCustomLocationIDOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ResourceSyncRuleListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.resourceName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const getOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.resourceName,
|
||||
Parameters.childResourceName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
|
||||
httpMethod: "PUT",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
202: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
204: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: Parameters.parameters3,
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.resourceName,
|
||||
Parameters.childResourceName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const deleteOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
|
||||
httpMethod: "DELETE",
|
||||
responses: {
|
||||
200: {},
|
||||
204: {},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.resourceName,
|
||||
Parameters.childResourceName
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
||||
const updateOperationSpec: coreClient.OperationSpec = {
|
||||
path:
|
||||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
|
||||
httpMethod: "PATCH",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
201: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
202: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
204: {
|
||||
bodyMapper: Mappers.ResourceSyncRule
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
requestBody: {
|
||||
parameterPath: {
|
||||
tags: ["options", "tags"],
|
||||
priority: ["options", "priority"],
|
||||
selector: ["options", "selector"],
|
||||
targetResourceGroup: ["options", "targetResourceGroup"]
|
||||
},
|
||||
mapper: { ...Mappers.PatchableResourceSyncRule, required: true }
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.resourceName,
|
||||
Parameters.childResourceName
|
||||
],
|
||||
headerParameters: [Parameters.accept, Parameters.contentType],
|
||||
mediaType: "json",
|
||||
serializer
|
||||
};
|
||||
const listByCustomLocationIDNextOperationSpec: coreClient.OperationSpec = {
|
||||
path: "{nextLink}",
|
||||
httpMethod: "GET",
|
||||
responses: {
|
||||
200: {
|
||||
bodyMapper: Mappers.ResourceSyncRuleListResult
|
||||
},
|
||||
default: {
|
||||
bodyMapper: Mappers.ErrorResponse
|
||||
}
|
||||
},
|
||||
queryParameters: [Parameters.apiVersion],
|
||||
urlParameters: [
|
||||
Parameters.$host,
|
||||
Parameters.subscriptionId,
|
||||
Parameters.resourceGroupName,
|
||||
Parameters.resourceName,
|
||||
Parameters.nextLink
|
||||
],
|
||||
headerParameters: [Parameters.accept],
|
||||
serializer
|
||||
};
|
|
@ -22,7 +22,10 @@ import {
|
|||
CustomLocationsCreateOrUpdateResponse,
|
||||
CustomLocationsDeleteOptionalParams,
|
||||
CustomLocationsUpdateOptionalParams,
|
||||
CustomLocationsUpdateResponse
|
||||
CustomLocationsUpdateResponse,
|
||||
CustomLocationFindTargetResourceGroupProperties,
|
||||
CustomLocationsFindTargetResourceGroupOptionalParams,
|
||||
CustomLocationsFindTargetResourceGroupResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
|
@ -140,4 +143,18 @@ export interface CustomLocations {
|
|||
resourceName: string,
|
||||
options?: CustomLocationsUpdateOptionalParams
|
||||
): Promise<CustomLocationsUpdateResponse>;
|
||||
/**
|
||||
* Returns the target resource group associated with the resource sync rules of the Custom Location
|
||||
* that match the rules passed in with the Find Target Resource Group Request.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param parameters Parameters of the find target resource group request.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
findTargetResourceGroup(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
parameters: CustomLocationFindTargetResourceGroupProperties,
|
||||
options?: CustomLocationsFindTargetResourceGroupOptionalParams
|
||||
): Promise<CustomLocationsFindTargetResourceGroupResponse>;
|
||||
}
|
||||
|
|
|
@ -7,3 +7,4 @@
|
|||
*/
|
||||
|
||||
export * from "./customLocations";
|
||||
export * from "./resourceSyncRules";
|
||||
|
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* Copyright (c) Microsoft Corporation.
|
||||
* Licensed under the MIT License.
|
||||
*
|
||||
* Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
*/
|
||||
|
||||
import { PagedAsyncIterableIterator } from "@azure/core-paging";
|
||||
import { PollerLike, PollOperationState } from "@azure/core-lro";
|
||||
import {
|
||||
ResourceSyncRule,
|
||||
ResourceSyncRulesListByCustomLocationIDOptionalParams,
|
||||
ResourceSyncRulesGetOptionalParams,
|
||||
ResourceSyncRulesGetResponse,
|
||||
ResourceSyncRulesCreateOrUpdateOptionalParams,
|
||||
ResourceSyncRulesCreateOrUpdateResponse,
|
||||
ResourceSyncRulesDeleteOptionalParams,
|
||||
ResourceSyncRulesUpdateOptionalParams,
|
||||
ResourceSyncRulesUpdateResponse
|
||||
} from "../models";
|
||||
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/** Interface representing a ResourceSyncRules. */
|
||||
export interface ResourceSyncRules {
|
||||
/**
|
||||
* Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
|
||||
* of each Resource Sync Rule
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
listByCustomLocationID(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
|
||||
): PagedAsyncIterableIterator<ResourceSyncRule>;
|
||||
/**
|
||||
* Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom
|
||||
* Location resource name and Resource Sync Rule name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
get(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesGetOptionalParams
|
||||
): Promise<ResourceSyncRulesGetResponse>;
|
||||
/**
|
||||
* Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
|
||||
* Group
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param parameters Parameters supplied to create or update a Resource Sync Rule.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateOrUpdate(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
parameters: ResourceSyncRule,
|
||||
options?: ResourceSyncRulesCreateOrUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<ResourceSyncRulesCreateOrUpdateResponse>,
|
||||
ResourceSyncRulesCreateOrUpdateResponse
|
||||
>
|
||||
>;
|
||||
/**
|
||||
* Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
|
||||
* Group
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param parameters Parameters supplied to create or update a Resource Sync Rule.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginCreateOrUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
parameters: ResourceSyncRule,
|
||||
options?: ResourceSyncRulesCreateOrUpdateOptionalParams
|
||||
): Promise<ResourceSyncRulesCreateOrUpdateResponse>;
|
||||
/**
|
||||
* Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource
|
||||
* Name, Resource Group, and Subscription Id.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
delete(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesDeleteOptionalParams
|
||||
): Promise<void>;
|
||||
/**
|
||||
* Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
|
||||
* Group, Subscription and Custom Location name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginUpdate(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesUpdateOptionalParams
|
||||
): Promise<
|
||||
PollerLike<
|
||||
PollOperationState<ResourceSyncRulesUpdateResponse>,
|
||||
ResourceSyncRulesUpdateResponse
|
||||
>
|
||||
>;
|
||||
/**
|
||||
* Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
|
||||
* Group, Subscription and Custom Location name.
|
||||
* @param resourceGroupName The name of the resource group. The name is case insensitive.
|
||||
* @param resourceName Custom Locations name.
|
||||
* @param childResourceName Resource Sync Rule name.
|
||||
* @param options The options parameters.
|
||||
*/
|
||||
beginUpdateAndWait(
|
||||
resourceGroupName: string,
|
||||
resourceName: string,
|
||||
childResourceName: string,
|
||||
options?: ResourceSyncRulesUpdateOptionalParams
|
||||
): Promise<ResourceSyncRulesUpdateResponse>;
|
||||
}
|
|
@ -7,35 +7,30 @@
|
|||
*/
|
||||
|
||||
import {
|
||||
env,
|
||||
record,
|
||||
RecorderEnvironmentSetup,
|
||||
Recorder
|
||||
Recorder,
|
||||
RecorderStartOptions,
|
||||
env
|
||||
} from "@azure-tools/test-recorder";
|
||||
import * as assert from "assert";
|
||||
import { assert } from "chai";
|
||||
import { Context } from "mocha";
|
||||
|
||||
const recorderEnvSetup: RecorderEnvironmentSetup = {
|
||||
replaceableVariables: {
|
||||
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"
|
||||
},
|
||||
customizationsOnRecordings: [
|
||||
(recording: any): any =>
|
||||
recording.replace(
|
||||
/"access_token":"[^"]*"/g,
|
||||
`"access_token":"access_token"`
|
||||
)
|
||||
],
|
||||
queryParametersToSkip: []
|
||||
const replaceableVariables: Record<string, string> = {
|
||||
AZURE_CLIENT_ID: "azure_client_id",
|
||||
AZURE_CLIENT_SECRET: "azure_client_secret",
|
||||
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
|
||||
SUBSCRIPTION_ID: "azure_subscription_id"
|
||||
};
|
||||
|
||||
const recorderOptions: RecorderStartOptions = {
|
||||
envSetupForPlayback: replaceableVariables
|
||||
};
|
||||
|
||||
describe("My test", () => {
|
||||
let recorder: Recorder;
|
||||
|
||||
beforeEach(async function() {
|
||||
recorder = record(this, recorderEnvSetup);
|
||||
beforeEach(async function(this: Context) {
|
||||
recorder = new Recorder(this.currentTest);
|
||||
await recorder.start(recorderOptions);
|
||||
});
|
||||
|
||||
afterEach(async function() {
|
||||
|
|
|
@ -9,11 +9,25 @@
|
|||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"lib": ["es6", "dom"],
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"declaration": true,
|
||||
"outDir": "./dist-esm",
|
||||
"importHelpers": true
|
||||
"importHelpers": true,
|
||||
"paths": {
|
||||
"@azure/arm-extendedlocation": [
|
||||
"./src/index"
|
||||
]
|
||||
}
|
||||
},
|
||||
"include": ["./src/**/*.ts", "./test/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
"include": [
|
||||
"./src/**/*.ts",
|
||||
"./test/**/*.ts",
|
||||
"samples-dev/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
|
||||
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
include:
|
||||
|
@ -9,7 +9,7 @@ trigger:
|
|||
paths:
|
||||
include:
|
||||
- sdk/extendedlocation/ci.mgmt.yml
|
||||
- sdk/extendedlocation/arm-extendedlocation/
|
||||
- sdk/extendedlocation/arm-extendedlocation
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
|
@ -22,12 +22,11 @@ pr:
|
|||
paths:
|
||||
include:
|
||||
- sdk/extendedlocation/ci.mgmt.yml
|
||||
- sdk/extendedlocation/arm-extendedlocation/
|
||||
|
||||
- sdk/extendedlocation/arm-extendedlocation
|
||||
extends:
|
||||
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
|
||||
parameters:
|
||||
ServiceDirectory: extendedlocation
|
||||
Artifacts:
|
||||
- name: azure-arm-extendedlocation
|
||||
safeName: azurearmextendedlocation
|
||||
safeName: azurearmextendedlocation
|
||||
|
|
Загрузка…
Ссылка в новой задаче