ZiWei Chen 2024-10-28 12:51:24 +08:00 коммит произвёл GitHub
Родитель a64890eedb
Коммит 44ac46139d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
41 изменённых файлов: 2178 добавлений и 28 удалений

3
.github/CODEOWNERS поставляемый
Просмотреть файл

@ -467,6 +467,9 @@ sdk/ai/ai-inference-rest @glharper @dargilco @jhakulin
# PRLabel: %Mgmt
/sdk/datafactory/arm-datafactory/ @qiaozha @MaryGao
# PRLabel: %Mgmt
/sdk/databoundaries/arm-databoundaries/ @qiaozha @MaryGao
# PRLabel: %Mgmt
/sdk/datalake-analytics/arm-datalake-analytics/ @qiaozha @MaryGao

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

@ -236,6 +236,9 @@ dependencies:
'@rush-temp/arm-dashboard':
specifier: file:./projects/arm-dashboard.tgz
version: file:projects/arm-dashboard.tgz
'@rush-temp/arm-databoundaries':
specifier: file:./projects/arm-databoundaries.tgz
version: file:projects/arm-databoundaries.tgz
'@rush-temp/arm-databox':
specifier: file:./projects/arm-databox.tgz
version: file:projects/arm-databox.tgz
@ -3913,13 +3916,13 @@ packages:
resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==}
dependencies:
'@types/connect': 3.4.38
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/bunyan@1.8.9:
resolution: {integrity: sha512-ZqS9JGpBxVOvsawzmVt30sP++gSQMTejCkIAQ3VdadOcRE8izTyW66hufvwLeH+YEGP6Js2AW7Gz+RMyvrEbmw==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/chai-as-promised@7.1.8:
@ -3945,7 +3948,7 @@ packages:
/@types/connect@3.4.38:
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/cookie@0.4.1:
@ -3959,7 +3962,7 @@ packages:
/@types/cors@2.8.17:
resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/debug@4.1.12:
@ -3971,7 +3974,7 @@ packages:
/@types/decompress@4.2.7:
resolution: {integrity: sha512-9z+8yjKr5Wn73Pt17/ldnmQToaFHZxK0N1GHysuk/JIPT8RIdQeoInM01wWPgypRcvb6VH1drjuFpQ4zmY437g==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/eslint-config-prettier@6.11.3:
@ -3998,7 +4001,7 @@ packages:
/@types/express-serve-static-core@4.19.6:
resolution: {integrity: sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
'@types/qs': 6.9.16
'@types/range-parser': 1.2.7
'@types/send': 0.17.4
@ -4017,7 +4020,7 @@ packages:
resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==}
dependencies:
'@types/jsonfile': 6.1.4
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/http-errors@2.0.4:
@ -4034,7 +4037,7 @@ packages:
/@types/is-buffer@2.0.2:
resolution: {integrity: sha512-G6OXy83Va+xEo8XgqAJYOuvOMxeey9xM5XKkvwJNmN8rVdcB+r15HvHsG86hl86JvU0y1aa7Z2ERkNFYWw9ySg==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/json-schema@7.0.15:
@ -4044,19 +4047,19 @@ packages:
/@types/jsonfile@6.1.4:
resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/jsonwebtoken@9.0.7:
resolution: {integrity: sha512-ugo316mmTYBl2g81zDFnZ7cfxlut3o+/EQdaP7J8QN2kY6lJ22hmQYCK5EHcJHbrW+dkCGSCPgbG8JtYj6qSrg==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/jws@3.2.10:
resolution: {integrity: sha512-cOevhttJmssERB88/+XvZXvsq5m9JLKZNUiGfgjUb5lcPRdV2ZQciU6dU76D/qXXFYpSqkP3PrSg4hMTiafTZw==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/linkify-it@5.0.0:
@ -4109,13 +4112,13 @@ packages:
/@types/mysql@2.15.26:
resolution: {integrity: sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/node-fetch@2.6.11:
resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
form-data: 4.0.1
dev: false
@ -4160,7 +4163,7 @@ packages:
/@types/pg@8.6.1:
resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
pg-protocol: 1.7.0
pg-types: 2.2.0
dev: false
@ -4172,7 +4175,7 @@ packages:
/@types/prompts@2.4.9:
resolution: {integrity: sha512-qTxFi6Buiu8+50/+3DGIWLHM6QuWsEKugJnnP6iv2Mc4ncxE4A/OJkjuVOA+5X0X1S/nq5VJRa8Lu+nwcvbrKA==}
dependencies:
'@types/node': 20.16.13
'@types/node': 22.7.7
kleur: 3.0.3
dev: false
@ -4187,7 +4190,7 @@ packages:
/@types/readdir-glob@1.1.5:
resolution: {integrity: sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/resolve@1.20.2:
@ -4206,14 +4209,14 @@ packages:
resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==}
dependencies:
'@types/mime': 1.3.5
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/serve-static@1.15.7:
resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==}
dependencies:
'@types/http-errors': 2.0.4
'@types/node': 18.19.57
'@types/node': 22.7.7
'@types/send': 0.17.4
dev: false
@ -4238,13 +4241,13 @@ packages:
/@types/stoppable@1.1.3:
resolution: {integrity: sha512-7wGKIBJGE4ZxFjk9NkjAxZMLlIXroETqP1FJCdoSvKmEznwmBxQFmTB1dsCkAvVcNemuSZM5qkkd9HE/NL2JTw==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/through@0.0.33:
resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/tough-cookie@4.0.5:
@ -4278,13 +4281,13 @@ packages:
/@types/ws@7.4.7:
resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/ws@8.5.12:
resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==}
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
/@types/yargs-parser@21.0.3:
@ -4301,7 +4304,7 @@ packages:
resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
requiresBuild: true
dependencies:
'@types/node': 18.19.57
'@types/node': 22.7.7
dev: false
optional: true
@ -6075,7 +6078,7 @@ packages:
dependencies:
'@types/cookie': 0.4.1
'@types/cors': 2.8.17
'@types/node': 18.19.57
'@types/node': 22.7.7
accepts: 1.3.8
base64id: 2.0.0
cookie: 0.7.2
@ -9452,7 +9455,7 @@ packages:
'@protobufjs/path': 1.1.2
'@protobufjs/pool': 1.1.0
'@protobufjs/utf8': 1.1.0
'@types/node': 18.19.57
'@types/node': 22.7.7
long: 5.2.3
dev: false
@ -10682,6 +10685,37 @@ packages:
yn: 3.1.1
dev: false
/ts-node@10.9.2(@types/node@18.19.57)(typescript@5.5.4):
resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
'@types/node': '*'
typescript: '>=2.7'
peerDependenciesMeta:
'@swc/core':
optional: true
'@swc/wasm':
optional: true
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.11
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4
'@types/node': 18.19.57
acorn: 8.13.0
acorn-walk: 8.3.4
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 5.5.4
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: false
/ts-node@10.9.2(@types/node@18.19.57)(typescript@5.6.3):
resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}
hasBin: true
@ -10933,6 +10967,12 @@ packages:
hasBin: true
dev: false
/typescript@5.5.4:
resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==}
engines: {node: '>=14.17'}
hasBin: true
dev: false
/typescript@5.6.3:
resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==}
engines: {node: '>=14.17'}
@ -14167,7 +14207,7 @@ packages:
dev: false
file:projects/arm-cosmosdb.tgz:
resolution: {integrity: sha512-2v6rqNsp3P65qn1zTQugNY4WpyjrpSlNV4fJiakvfiwyCdgDP7roXWbcXGfrp3KDJXH0soobfEehPV8zfDfWJw==, tarball: file:projects/arm-cosmosdb.tgz}
resolution: {integrity: sha512-isHxEpq7bScszTE3o6ML/F7FgseAxz0jzQ3QvL06v/O+x7cW+0eSKoIxnFy0qGk4DvUqGJylr2FtoVBmAKGmvA==, tarball: file:projects/arm-cosmosdb.tgz}
name: '@rush-temp/arm-cosmosdb'
version: 0.0.0
dependencies:
@ -14311,6 +14351,34 @@ packages:
- supports-color
dev: false
file:projects/arm-databoundaries.tgz:
resolution: {integrity: sha512-Fw6ijgZwAN7M320V/K8VLK3R8zO36Wu728GC3VZVcWMZJnkyCy8XypCKB2ciNooQOG72weEz3LYObsl8MPpfaQ==, tarball: file:projects/arm-databoundaries.tgz}
name: '@rush-temp/arm-databoundaries'
version: 0.0.0
dependencies:
'@azure-tools/test-credential': 1.3.1
'@azure-tools/test-recorder': 3.5.2
'@microsoft/api-extractor': 7.47.11(@types/node@18.19.57)
'@types/chai': 4.3.20
'@types/mocha': 10.0.9
'@types/node': 18.19.57
chai: 4.3.10
cross-env: 7.0.3
dotenv: 16.4.5
mkdirp: 3.0.1
mocha: 10.7.3
rimraf: 5.0.10
ts-node: 10.9.2(@types/node@18.19.57)(typescript@5.5.4)
tslib: 2.8.0
tsx: 4.19.1
typescript: 5.5.4
uglify-js: 3.19.3
transitivePeerDependencies:
- '@swc/core'
- '@swc/wasm'
- supports-color
dev: false
file:projects/arm-databox.tgz:
resolution: {integrity: sha512-exRqOsMMt+ar0ORBYHzw0cPIpjfE5lBzlC7Oj4H1Sbck+cLM1eGLiQ5Cpan32uSJBRZkRhBZe7jju+TzMP9iAQ==, tarball: file:projects/arm-databox.tgz}
name: '@rush-temp/arm-databox'
@ -15186,7 +15254,7 @@ packages:
dev: false
file:projects/arm-elasticsan.tgz:
resolution: {integrity: sha512-dy6sMLYtkbQs07JJoBu5N5PkTJ7i0fVLW3Gdl894VJaww9EFAYc9pCrMLhsOSBLvmfzgwpyAY2L1DGg7h5Yi4Q==, tarball: file:projects/arm-elasticsan.tgz}
resolution: {integrity: sha512-5/gwmooleUnum1LJ7BaIOssENX8rSEtb6cy1TK3nh1CCzNlXIH+G5QF16/KPT4+OH6+WdAwLjrATGxX/caI6gg==, tarball: file:projects/arm-elasticsan.tgz}
name: '@rush-temp/arm-elasticsan'
version: 0.0.0
dependencies:
@ -15334,7 +15402,7 @@ packages:
dev: false
file:projects/arm-fabric.tgz:
resolution: {integrity: sha512-fsC4YDGpwTkL2mW+m3h1FKq4LnKMTIJcdcznTRbca/Qv53WZvkng75BBWLXy/oTbT6yz7zIk7m4MtaxL9vgc1Q==, tarball: file:projects/arm-fabric.tgz}
resolution: {integrity: sha512-DWfFgqHfgTiuH3NNu60qsQbVvXs1fKragfniZrJLTdbpqS+qbT6vpDjhYG/kuLN/FmX8ls89FAUd6T+etr8Hpg==, tarball: file:projects/arm-fabric.tgz}
name: '@rush-temp/arm-fabric'
version: 0.0.0
dependencies:

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

@ -12,3 +12,4 @@ https://docs.microsoft.com/javascript/api/@azure/arm-fabric?view=azure-node-prev
https://docs.microsoft.com/javascript/api/@azure/arm-trustedsigning?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-containerorchestratorruntime?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-iotoperations?view=azure-node-preview
https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview

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

@ -2297,6 +2297,11 @@
"projectFolder": "sdk/trustedsigning/arm-trustedsigning",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-databoundaries",
"projectFolder": "sdk/databoundaries/arm-databoundaries",
"versionPolicyName": "management"
},
{
"packageName": "@azure/arm-containerorchestratorruntime",
"projectFolder": "sdk/kubernetesruntime/arm-containerorchestratorruntime",

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

@ -0,0 +1,7 @@
# Release History
## 1.0.0-beta.1 (2024-10-25)
### Features Added
The package of @azure/arm-databoundaries is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart).

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

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

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

@ -0,0 +1,108 @@
# Azure DataboundariesManegement client library for JavaScript
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure DataboundariesManegement client.
Provides APIs for data boundary operations.
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-databoundaries) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
## Getting started
### Currently supported environments
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
- Latest versions of Safari, Chrome, Edge and Firefox.
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
### Prerequisites
- An [Azure subscription][azure_sub].
### Install the `@azure/arm-databoundaries` package
Install the Azure DataboundariesManegement client library for JavaScript with `npm`:
```bash
npm install @azure/arm-databoundaries
```
### Create and authenticate a `DataboundariesManegementClient`
To create a client object to access the Azure DataboundariesManegement API, you will need the `endpoint` of your Azure DataboundariesManegement resource and a `credential`. The Azure DataboundariesManegement client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure DataboundariesManegement resource in the [Azure Portal][azure_portal].
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
```bash
npm install @azure/identity
```
You will also need to **register a new AAD application and grant access to Azure DataboundariesManegement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
```javascript
const { DataboundariesManegementClient } = require("@azure/arm-databoundaries");
const { DefaultAzureCredential } = require("@azure/identity");
// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
const client = new DataboundariesManegementClient(new DefaultAzureCredential());
// For client-side applications running in the browser, use this code instead:
// const credential = new InteractiveBrowserCredential({
// tenantId: "<YOUR_TENANT_ID>",
// clientId: "<YOUR_CLIENT_ID>"
// });
// const client = new DataboundariesManegementClient(credential);
```
### JavaScript Bundle
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
## Key concepts
### DataboundariesManegementClient
`DataboundariesManegementClient` is the primary interface for developers using the Azure DataboundariesManegement client library. Explore the methods on this client object to understand the different features of the Azure DataboundariesManegement service that you can access.
## Troubleshooting
### Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
```javascript
const { setLogLevel } = require("@azure/logger");
setLogLevel("info");
```
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
## Next steps
Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library.
## Contributing
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
## Related projects
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fdataboundaries%2Farm-databoundaries%2FREADME.png)
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[azure_sub]: https://azure.microsoft.com/free/
[azure_portal]: https://portal.azure.com
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

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

@ -0,0 +1,8 @@
{
"commit": "bc3aa2bbc4494553649019585c3bc8a4229a25d0",
"readme": "specification/resources/resource-manager/readme.md",
"autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.27 --generate-sample=true",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.15",
"use": "@autorest/typescript@6.0.27"
}

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

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

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

@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "js",
"TagPrefix": "js/databoundaries/arm-databoundaries",
"Tag": "js/databoundaries/arm-databoundaries_1b391e73f0"
}

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

@ -0,0 +1,115 @@
{
"name": "@azure/arm-databoundaries",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for DataboundariesManegementClient.",
"version": "1.0.0-beta.1",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
"types": "./types/arm-databoundaries.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.31.1",
"mkdirp": "^3.0.1",
"typescript": "~5.5.3",
"uglify-js": "^3.4.9",
"rimraf": "^5.0.0",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.2.1",
"@azure-tools/test-recorder": "^3.0.0",
"@azure-tools/test-credential": "^1.1.0",
"mocha": "^10.0.0",
"@types/mocha": "^10.0.0",
"tsx": "^4.7.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@types/node": "^18.0.0",
"ts-node": "^10.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"dist/**/*.d.ts",
"dist/**/*.d.ts.map",
"dist-esm/**/*.js",
"dist-esm/**/*.js.map",
"dist-esm/**/*.d.ts",
"dist-esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"tsconfig.json",
"review/*",
"CHANGELOG.md",
"types/*"
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && 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": "dev-tool run extract-api",
"lint": "echo skipped",
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"execute:samples": "echo skipped",
"format": "echo skipped",
"test": "npm run integration-test",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/databoundariesManegementClient.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview"
}
}

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

@ -0,0 +1,154 @@
## API Report File for "@azure/arm-databoundaries"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import * as coreAuth from '@azure/core-auth';
import * as coreClient from '@azure/core-client';
// @public
export type CreatedByType = string;
// @public
export interface DataBoundaries {
getScope(scope: string, defaultParam: DefaultName, options?: DataBoundariesGetScopeOptionalParams): Promise<DataBoundariesGetScopeResponse>;
getTenant(defaultParam: DefaultName, options?: DataBoundariesGetTenantOptionalParams): Promise<DataBoundariesGetTenantResponse>;
put(defaultParam: DefaultName, dataBoundaryDefinition: DataBoundaryDefinition, options?: DataBoundariesPutOptionalParams): Promise<DataBoundariesPutResponse>;
}
// @public
export interface DataBoundariesGetScopeOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DataBoundariesGetScopeResponse = DataBoundaryDefinition;
// @public
export interface DataBoundariesGetTenantOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DataBoundariesGetTenantResponse = DataBoundaryDefinition;
// @public (undocumented)
export class DataboundariesManegementClient extends coreClient.ServiceClient {
// (undocumented)
$host: string;
constructor(credentials: coreAuth.TokenCredential, options?: DataboundariesManegementClientOptionalParams);
// (undocumented)
apiVersion: string;
// (undocumented)
dataBoundaries: DataBoundaries;
}
// @public
export interface DataboundariesManegementClientOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}
// @public
export interface DataBoundariesPutOptionalParams extends coreClient.OperationOptions {
}
// @public
export type DataBoundariesPutResponse = DataBoundaryDefinition;
// @public
export type DataBoundary = string;
// @public
export interface DataBoundaryDefinition extends ProxyResource {
properties?: DataBoundaryProperties;
}
// @public
export interface DataBoundaryProperties {
dataBoundary?: DataBoundary;
readonly provisioningState?: ProvisioningState;
}
// @public
export type DefaultName = string;
// @public
export interface ErrorAdditionalInfo {
readonly info?: Record<string, unknown>;
readonly type?: string;
}
// @public
export interface ErrorDetail {
readonly additionalInfo?: ErrorAdditionalInfo[];
readonly code?: string;
readonly details?: ErrorDetail[];
readonly message?: string;
readonly target?: string;
}
// @public
export interface ErrorResponse {
error?: ErrorDetail;
}
// @public
export enum KnownCreatedByType {
Application = "Application",
Key = "Key",
ManagedIdentity = "ManagedIdentity",
User = "User"
}
// @public
export enum KnownDataBoundary {
EU = "EU",
Global = "Global",
NotDefined = "NotDefined"
}
// @public
export enum KnownDefaultName {
Default = "default"
}
// @public
export enum KnownProvisioningState {
Accepted = "Accepted",
Canceled = "Canceled",
Creating = "Creating",
Failed = "Failed",
Running = "Running",
Succeeded = "Succeeded",
Updating = "Updating"
}
// @public
export type ProvisioningState = string;
// @public
export interface ProxyResource extends Resource {
}
// @public
export interface Resource {
readonly id?: string;
readonly name?: string;
readonly systemData?: SystemData;
readonly type?: string;
}
// @public
export interface SystemData {
createdAt?: Date;
createdBy?: string;
createdByType?: CreatedByType;
lastModifiedAt?: Date;
lastModifiedBy?: string;
lastModifiedByType?: CreatedByType;
}
// (No @packageDocumentation comment for this package)
```

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

@ -0,0 +1 @@
# Feel free to add your own environment variables.

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

@ -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 { DataboundariesManegementClient } from "@azure/arm-databoundaries";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get data boundary at specified scope
*
* @summary Get data boundary at specified scope
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetScopedDataBoundary.json
*/
async function getDataBoundaryAtScope() {
const scope =
"subscriptions/11111111-1111-1111-1111-111111111111/resourcegroups/my-resource-group";
const defaultParam = "default";
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.getScope(scope, defaultParam);
console.log(result);
}
async function main() {
getDataBoundaryAtScope();
}
main().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { DataboundariesManegementClient } from "@azure/arm-databoundaries";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get data boundary of tenant.
*
* @summary Get data boundary of tenant.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetTenantDataBoundary.json
*/
async function getDataBoundaryForTenant() {
const defaultParam = "default";
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.getTenant(defaultParam);
console.log(result);
}
async function main() {
getDataBoundaryForTenant();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
DataBoundaryDefinition,
DataboundariesManegementClient,
} from "@azure/arm-databoundaries";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Opt-in tenant to data boundary.
*
* @summary Opt-in tenant to data boundary.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/PutDataBoundary.json
*/
async function optInToDataBoundary() {
const defaultParam = "default";
const dataBoundaryDefinition: DataBoundaryDefinition = {
properties: { dataBoundary: "EU" },
};
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.put(
defaultParam,
dataBoundaryDefinition,
);
console.log(result);
}
async function main() {
optInToDataBoundary();
}
main().catch(console.error);

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

@ -0,0 +1,54 @@
# 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** |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [dataBoundariesGetScopeSample.js][databoundariesgetscopesample] | Get data boundary at specified scope x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetScopedDataBoundary.json |
| [dataBoundariesGetTenantSample.js][databoundariesgettenantsample] | Get data boundary of tenant. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetTenantDataBoundary.json |
| [dataBoundariesPutSample.js][databoundariesputsample] | Opt-in tenant to data boundary. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/PutDataBoundary.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
3. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dataBoundariesGetScopeSample.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 dataBoundariesGetScopeSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[databoundariesgetscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/databoundaries/arm-databoundaries/samples/v1-beta/javascript/dataBoundariesGetScopeSample.js
[databoundariesgettenantsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/databoundaries/arm-databoundaries/samples/v1-beta/javascript/dataBoundariesGetTenantSample.js
[databoundariesputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/databoundaries/arm-databoundaries/samples/v1-beta/javascript/dataBoundariesPutSample.js
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries/README.md

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

@ -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 { DataboundariesManegementClient } = require("@azure/arm-databoundaries");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get data boundary at specified scope
*
* @summary Get data boundary at specified scope
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetScopedDataBoundary.json
*/
async function getDataBoundaryAtScope() {
const scope =
"subscriptions/11111111-1111-1111-1111-111111111111/resourcegroups/my-resource-group";
const defaultParam = "default";
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.getScope(scope, defaultParam);
console.log(result);
}
async function main() {
getDataBoundaryAtScope();
}
main().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 { DataboundariesManegementClient } = require("@azure/arm-databoundaries");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Get data boundary of tenant.
*
* @summary Get data boundary of tenant.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetTenantDataBoundary.json
*/
async function getDataBoundaryForTenant() {
const defaultParam = "default";
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.getTenant(defaultParam);
console.log(result);
}
async function main() {
getDataBoundaryForTenant();
}
main().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 { DataboundariesManegementClient } = require("@azure/arm-databoundaries");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv").config();
/**
* This sample demonstrates how to Opt-in tenant to data boundary.
*
* @summary Opt-in tenant to data boundary.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/PutDataBoundary.json
*/
async function optInToDataBoundary() {
const defaultParam = "default";
const dataBoundaryDefinition = {
properties: { dataBoundary: "EU" },
};
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.put(defaultParam, dataBoundaryDefinition);
console.log(result);
}
async function main() {
optInToDataBoundary();
}
main().catch(console.error);

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

@ -0,0 +1,32 @@
{
"name": "@azure-samples/arm-databoundaries-js-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for JavaScript (Beta)",
"engines": {
"node": ">=18.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/databoundaries/arm-databoundaries"
},
"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/databoundaries/arm-databoundaries",
"dependencies": {
"@azure/arm-databoundaries": "next",
"dotenv": "latest",
"@azure/identity": "^4.2.1"
}
}

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

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

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

@ -0,0 +1,67 @@
# 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** |
| ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [dataBoundariesGetScopeSample.ts][databoundariesgetscopesample] | Get data boundary at specified scope x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetScopedDataBoundary.json |
| [dataBoundariesGetTenantSample.ts][databoundariesgettenantsample] | Get data boundary of tenant. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetTenantDataBoundary.json |
| [dataBoundariesPutSample.ts][databoundariesputsample] | Opt-in tenant to data boundary. x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/PutDataBoundary.json |
## Prerequisites
The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule).
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using:
```bash
npm install -g typescript
```
You need [an Azure subscription][freesub] to run these sample programs.
Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.
Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package].
## Setup
To run the samples using the published version of the package:
1. Install the dependencies using `npm`:
```bash
npm install
```
2. Compile the samples:
```bash
npm run build
```
3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically.
4. Run whichever samples you like (note that some samples may require additional setup, see the table above):
```bash
node dist/dataBoundariesGetScopeSample.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/dataBoundariesGetScopeSample.js
```
## Next Steps
Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients.
[databoundariesgetscopesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/databoundaries/arm-databoundaries/samples/v1-beta/typescript/src/dataBoundariesGetScopeSample.ts
[databoundariesgettenantsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/databoundaries/arm-databoundaries/samples/v1-beta/typescript/src/dataBoundariesGetTenantSample.ts
[databoundariesputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/databoundaries/arm-databoundaries/samples/v1-beta/typescript/src/dataBoundariesPutSample.ts
[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-databoundaries?view=azure-node-preview
[freesub]: https://azure.microsoft.com/free/
[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/databoundaries/arm-databoundaries/README.md
[typescript]: https://www.typescriptlang.org/docs/home.html

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

@ -0,0 +1,41 @@
{
"name": "@azure-samples/arm-databoundaries-ts-beta",
"private": true,
"version": "1.0.0",
"description": " client library samples for TypeScript (Beta)",
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"build": "tsc",
"prebuild": "rimraf dist/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Azure/azure-sdk-for-js.git",
"directory": "sdk/databoundaries/arm-databoundaries"
},
"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/databoundaries/arm-databoundaries",
"dependencies": {
"@azure/arm-databoundaries": "next",
"dotenv": "latest",
"@azure/identity": "^4.2.1"
},
"devDependencies": {
"@types/node": "^18.0.0",
"typescript": "~5.6.2",
"rimraf": "latest"
}
}

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

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

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

@ -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 { DataboundariesManegementClient } from "@azure/arm-databoundaries";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get data boundary at specified scope
*
* @summary Get data boundary at specified scope
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetScopedDataBoundary.json
*/
async function getDataBoundaryAtScope() {
const scope =
"subscriptions/11111111-1111-1111-1111-111111111111/resourcegroups/my-resource-group";
const defaultParam = "default";
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.getScope(scope, defaultParam);
console.log(result);
}
async function main() {
getDataBoundaryAtScope();
}
main().catch(console.error);

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

@ -0,0 +1,35 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { DataboundariesManegementClient } from "@azure/arm-databoundaries";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Get data boundary of tenant.
*
* @summary Get data boundary of tenant.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/GetTenantDataBoundary.json
*/
async function getDataBoundaryForTenant() {
const defaultParam = "default";
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.getTenant(defaultParam);
console.log(result);
}
async function main() {
getDataBoundaryForTenant();
}
main().catch(console.error);

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

@ -0,0 +1,44 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import {
DataBoundaryDefinition,
DataboundariesManegementClient,
} from "@azure/arm-databoundaries";
import { DefaultAzureCredential } from "@azure/identity";
import * as dotenv from "dotenv";
dotenv.config();
/**
* This sample demonstrates how to Opt-in tenant to data boundary.
*
* @summary Opt-in tenant to data boundary.
* x-ms-original-file: specification/resources/resource-manager/Microsoft.Resources/stable/2024-08-01/examples/PutDataBoundary.json
*/
async function optInToDataBoundary() {
const defaultParam = "default";
const dataBoundaryDefinition: DataBoundaryDefinition = {
properties: { dataBoundary: "EU" },
};
const credential = new DefaultAzureCredential();
const client = new DataboundariesManegementClient(credential);
const result = await client.dataBoundaries.put(
defaultParam,
dataBoundaryDefinition,
);
console.log(result);
}
async function main() {
optInToDataBoundary();
}
main().catch(console.error);

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

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

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

@ -0,0 +1,133 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest,
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import { DataBoundariesImpl } from "./operations";
import { DataBoundaries } from "./operationsInterfaces";
import { DataboundariesManegementClientOptionalParams } from "./models";
export class DataboundariesManegementClient extends coreClient.ServiceClient {
$host: string;
apiVersion: string;
/**
* Initializes a new instance of the DataboundariesManegementClient class.
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param options The parameter options
*/
constructor(
credentials: coreAuth.TokenCredential,
options?: DataboundariesManegementClientOptionalParams,
) {
if (credentials === undefined) {
throw new Error("'credentials' cannot be null");
}
// Initializing default values for options
if (!options) {
options = {};
}
const defaults: DataboundariesManegementClientOptionalParams = {
requestContentType: "application/json; charset=utf-8",
credential: credentials,
};
const packageDetails = `azsdk-js-arm-databoundaries/1.0.0-beta.1`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
: `${packageDetails}`;
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix,
},
endpoint:
options.endpoint ?? options.baseUri ?? "https://management.azure.com",
};
super(optionsWithDefaults);
let bearerTokenAuthenticationPolicyFound: boolean = false;
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] =
options.pipeline.getOrderedPolicies();
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
(pipelinePolicy) =>
pipelinePolicy.name ===
coreRestPipeline.bearerTokenAuthenticationPolicyName,
);
}
if (
!options ||
!options.pipeline ||
options.pipeline.getOrderedPolicies().length == 0 ||
!bearerTokenAuthenticationPolicyFound
) {
this.pipeline.removePolicy({
name: coreRestPipeline.bearerTokenAuthenticationPolicyName,
});
this.pipeline.addPolicy(
coreRestPipeline.bearerTokenAuthenticationPolicy({
credential: credentials,
scopes:
optionsWithDefaults.credentialScopes ??
`${optionsWithDefaults.endpoint}/.default`,
challengeCallbacks: {
authorizeRequestOnChallenge:
coreClient.authorizeRequestOnClaimChallenge,
},
}),
);
}
// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2024-08-01";
this.dataBoundaries = new DataBoundariesImpl(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);
}
dataBoundaries: DataBoundaries;
}

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

@ -0,0 +1,11 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./models";
export { DataboundariesManegementClient } from "./databoundariesManegementClient";
export * from "./operationsInterfaces";

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

@ -0,0 +1,243 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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";
/** Data boundary properties */
export interface DataBoundaryProperties {
/** The data boundary definition. */
dataBoundary?: DataBoundary;
/**
* Denotes the state of provisioning.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly provisioningState?: ProvisioningState;
}
/** Common fields that are returned in the response for all Azure Resource Manager resources */
export interface Resource {
/**
* Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly id?: string;
/**
* The name of the resource
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly name?: string;
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly systemData?: SystemData;
}
/** Metadata pertaining to creation and last modification of the resource. */
export interface SystemData {
/** The identity that created the resource. */
createdBy?: string;
/** The type of identity that created the resource. */
createdByType?: CreatedByType;
/** The timestamp of resource creation (UTC). */
createdAt?: Date;
/** The identity that last modified the resource. */
lastModifiedBy?: string;
/** The type of identity that last modified the resource. */
lastModifiedByType?: CreatedByType;
/** The timestamp of resource last modification (UTC) */
lastModifiedAt?: Date;
}
/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */
export interface ErrorResponse {
/** The error object. */
error?: ErrorDetail;
}
/** The error detail. */
export interface ErrorDetail {
/**
* The error code.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly code?: string;
/**
* The error message.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly message?: string;
/**
* The error target.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly target?: string;
/**
* The error details.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly details?: ErrorDetail[];
/**
* The error additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly additionalInfo?: ErrorAdditionalInfo[];
}
/** The resource management error additional info. */
export interface ErrorAdditionalInfo {
/**
* The additional info type.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly type?: string;
/**
* The additional info.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly info?: Record<string, unknown>;
}
/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */
export interface ProxyResource extends Resource {}
/** A data boundary definition. */
export interface DataBoundaryDefinition extends ProxyResource {
/** Data boundary properties */
properties?: DataBoundaryProperties;
}
/** Known values of {@link DefaultName} that the service accepts. */
export enum KnownDefaultName {
/** Default */
Default = "default",
}
/**
* Defines values for DefaultName. \
* {@link KnownDefaultName} can be used interchangeably with DefaultName,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **default**
*/
export type DefaultName = string;
/** Known values of {@link DataBoundary} that the service accepts. */
export enum KnownDataBoundary {
/** NotDefined */
NotDefined = "NotDefined",
/** Global */
Global = "Global",
/** EU */
EU = "EU",
}
/**
* Defines values for DataBoundary. \
* {@link KnownDataBoundary} can be used interchangeably with DataBoundary,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **NotDefined** \
* **Global** \
* **EU**
*/
export type DataBoundary = string;
/** Known values of {@link ProvisioningState} that the service accepts. */
export enum KnownProvisioningState {
/** Accepted */
Accepted = "Accepted",
/** Running */
Running = "Running",
/** Creating */
Creating = "Creating",
/** Canceled */
Canceled = "Canceled",
/** Failed */
Failed = "Failed",
/** Succeeded */
Succeeded = "Succeeded",
/** Updating */
Updating = "Updating",
}
/**
* Defines values for ProvisioningState. \
* {@link KnownProvisioningState} can be used interchangeably with ProvisioningState,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **Accepted** \
* **Running** \
* **Creating** \
* **Canceled** \
* **Failed** \
* **Succeeded** \
* **Updating**
*/
export type ProvisioningState = string;
/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
/** User */
User = "User",
/** Application */
Application = "Application",
/** ManagedIdentity */
ManagedIdentity = "ManagedIdentity",
/** Key */
Key = "Key",
}
/**
* Defines values for CreatedByType. \
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **User** \
* **Application** \
* **ManagedIdentity** \
* **Key**
*/
export type CreatedByType = string;
/** Optional parameters. */
export interface DataBoundariesPutOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the put operation. */
export type DataBoundariesPutResponse = DataBoundaryDefinition;
/** Optional parameters. */
export interface DataBoundariesGetTenantOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the getTenant operation. */
export type DataBoundariesGetTenantResponse = DataBoundaryDefinition;
/** Optional parameters. */
export interface DataBoundariesGetScopeOptionalParams
extends coreClient.OperationOptions {}
/** Contains response data for the getScope operation. */
export type DataBoundariesGetScopeResponse = DataBoundaryDefinition;
/** Optional parameters. */
export interface DataboundariesManegementClientOptionalParams
extends coreClient.ServiceClientOptions {
/** server parameter */
$host?: string;
/** Api Version */
apiVersion?: string;
/** Overrides client endpoint. */
endpoint?: string;
}

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

@ -0,0 +1,236 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as coreClient from "@azure/core-client";
export const DataBoundaryProperties: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DataBoundaryProperties",
modelProperties: {
dataBoundary: {
serializedName: "dataBoundary",
type: {
name: "String",
},
},
provisioningState: {
serializedName: "provisioningState",
readOnly: true,
type: {
name: "String",
},
},
},
},
};
export const Resource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "Resource",
modelProperties: {
id: {
serializedName: "id",
readOnly: true,
type: {
name: "String",
},
},
name: {
serializedName: "name",
readOnly: true,
type: {
name: "String",
},
},
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String",
},
},
systemData: {
serializedName: "systemData",
type: {
name: "Composite",
className: "SystemData",
},
},
},
},
};
export const SystemData: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SystemData",
modelProperties: {
createdBy: {
serializedName: "createdBy",
type: {
name: "String",
},
},
createdByType: {
serializedName: "createdByType",
type: {
name: "String",
},
},
createdAt: {
serializedName: "createdAt",
type: {
name: "DateTime",
},
},
lastModifiedBy: {
serializedName: "lastModifiedBy",
type: {
name: "String",
},
},
lastModifiedByType: {
serializedName: "lastModifiedByType",
type: {
name: "String",
},
},
lastModifiedAt: {
serializedName: "lastModifiedAt",
type: {
name: "DateTime",
},
},
},
},
};
export const ErrorResponse: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorResponse",
modelProperties: {
error: {
serializedName: "error",
type: {
name: "Composite",
className: "ErrorDetail",
},
},
},
},
};
export const ErrorDetail: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorDetail",
modelProperties: {
code: {
serializedName: "code",
readOnly: true,
type: {
name: "String",
},
},
message: {
serializedName: "message",
readOnly: true,
type: {
name: "String",
},
},
target: {
serializedName: "target",
readOnly: true,
type: {
name: "String",
},
},
details: {
serializedName: "details",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorDetail",
},
},
},
},
additionalInfo: {
serializedName: "additionalInfo",
readOnly: true,
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "ErrorAdditionalInfo",
},
},
},
},
},
},
};
export const ErrorAdditionalInfo: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ErrorAdditionalInfo",
modelProperties: {
type: {
serializedName: "type",
readOnly: true,
type: {
name: "String",
},
},
info: {
serializedName: "info",
readOnly: true,
type: {
name: "Dictionary",
value: { type: { name: "any" } },
},
},
},
},
};
export const ProxyResource: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "ProxyResource",
modelProperties: {
...Resource.type.modelProperties,
},
},
};
export const DataBoundaryDefinition: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "DataBoundaryDefinition",
modelProperties: {
...ProxyResource.type.modelProperties,
properties: {
serializedName: "properties",
type: {
name: "Composite",
className: "DataBoundaryProperties",
},
},
},
},
};

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

@ -0,0 +1,93 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
OperationParameter,
OperationURLParameter,
OperationQueryParameter,
} from "@azure/core-client";
import { DataBoundaryDefinition as DataBoundaryDefinitionMapper } from "../models/mappers";
export const contentType: OperationParameter = {
parameterPath: ["options", "contentType"],
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Content-Type",
type: {
name: "String",
},
},
};
export const dataBoundaryDefinition: OperationParameter = {
parameterPath: "dataBoundaryDefinition",
mapper: DataBoundaryDefinitionMapper,
};
export const accept: OperationParameter = {
parameterPath: "accept",
mapper: {
defaultValue: "application/json",
isConstant: true,
serializedName: "Accept",
type: {
name: "String",
},
},
};
export const $host: OperationURLParameter = {
parameterPath: "$host",
mapper: {
serializedName: "$host",
required: true,
type: {
name: "String",
},
},
skipEncoding: true,
};
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2024-08-01",
isConstant: true,
serializedName: "api-version",
type: {
name: "String",
},
},
};
export const defaultParam: OperationURLParameter = {
parameterPath: "defaultParam",
mapper: {
serializedName: "default",
required: true,
type: {
name: "String",
},
},
};
export const scope: OperationURLParameter = {
parameterPath: "scope",
mapper: {
constraints: {
MinLength: 1,
},
serializedName: "scope",
required: true,
type: {
name: "String",
},
},
skipEncoding: true,
};

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

@ -0,0 +1,141 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the 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 { DataBoundaries } from "../operationsInterfaces";
import * as coreClient from "@azure/core-client";
import * as Mappers from "../models/mappers";
import * as Parameters from "../models/parameters";
import { DataboundariesManegementClient } from "../databoundariesManegementClient";
import {
DataBoundaryDefinition,
DefaultName,
DataBoundariesPutOptionalParams,
DataBoundariesPutResponse,
DataBoundariesGetTenantOptionalParams,
DataBoundariesGetTenantResponse,
DataBoundariesGetScopeOptionalParams,
DataBoundariesGetScopeResponse,
} from "../models";
/** Class containing DataBoundaries operations. */
export class DataBoundariesImpl implements DataBoundaries {
private readonly client: DataboundariesManegementClient;
/**
* Initialize a new instance of the class DataBoundaries class.
* @param client Reference to the service client
*/
constructor(client: DataboundariesManegementClient) {
this.client = client;
}
/**
* Opt-in tenant to data boundary.
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
* @param dataBoundaryDefinition The data boundary to opt the tenant to.
* @param options The options parameters.
*/
put(
defaultParam: DefaultName,
dataBoundaryDefinition: DataBoundaryDefinition,
options?: DataBoundariesPutOptionalParams,
): Promise<DataBoundariesPutResponse> {
return this.client.sendOperationRequest(
{ defaultParam, dataBoundaryDefinition, options },
putOperationSpec,
);
}
/**
* Get data boundary of tenant.
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
* @param options The options parameters.
*/
getTenant(
defaultParam: DefaultName,
options?: DataBoundariesGetTenantOptionalParams,
): Promise<DataBoundariesGetTenantResponse> {
return this.client.sendOperationRequest(
{ defaultParam, options },
getTenantOperationSpec,
);
}
/**
* Get data boundary at specified scope
* @param scope The scope at which the operation is performed.
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
* @param options The options parameters.
*/
getScope(
scope: string,
defaultParam: DefaultName,
options?: DataBoundariesGetScopeOptionalParams,
): Promise<DataBoundariesGetScopeResponse> {
return this.client.sendOperationRequest(
{ scope, defaultParam, options },
getScopeOperationSpec,
);
}
}
// Operation Specifications
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
const putOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Resources/dataBoundaries/{default}",
httpMethod: "PUT",
responses: {
200: {
bodyMapper: Mappers.DataBoundaryDefinition,
},
201: {
bodyMapper: Mappers.DataBoundaryDefinition,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
requestBody: Parameters.dataBoundaryDefinition,
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.defaultParam],
headerParameters: [Parameters.contentType, Parameters.accept],
mediaType: "json",
serializer,
};
const getTenantOperationSpec: coreClient.OperationSpec = {
path: "/providers/Microsoft.Resources/dataBoundaries/{default}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.DataBoundaryDefinition,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.defaultParam],
headerParameters: [Parameters.accept],
serializer,
};
const getScopeOperationSpec: coreClient.OperationSpec = {
path: "/{scope}/providers/Microsoft.Resources/dataBoundaries/{default}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.DataBoundaryDefinition,
},
default: {
bodyMapper: Mappers.ErrorResponse,
},
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.$host, Parameters.defaultParam, Parameters.scope],
headerParameters: [Parameters.accept],
serializer,
};

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

@ -0,0 +1,9 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./dataBoundaries";

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

@ -0,0 +1,53 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
DataBoundaryDefinition,
DefaultName,
DataBoundariesPutOptionalParams,
DataBoundariesPutResponse,
DataBoundariesGetTenantOptionalParams,
DataBoundariesGetTenantResponse,
DataBoundariesGetScopeOptionalParams,
DataBoundariesGetScopeResponse,
} from "../models";
/** Interface representing a DataBoundaries. */
export interface DataBoundaries {
/**
* Opt-in tenant to data boundary.
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
* @param dataBoundaryDefinition The data boundary to opt the tenant to.
* @param options The options parameters.
*/
put(
defaultParam: DefaultName,
dataBoundaryDefinition: DataBoundaryDefinition,
options?: DataBoundariesPutOptionalParams,
): Promise<DataBoundariesPutResponse>;
/**
* Get data boundary of tenant.
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
* @param options The options parameters.
*/
getTenant(
defaultParam: DefaultName,
options?: DataBoundariesGetTenantOptionalParams,
): Promise<DataBoundariesGetTenantResponse>;
/**
* Get data boundary at specified scope
* @param scope The scope at which the operation is performed.
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
* @param options The options parameters.
*/
getScope(
scope: string,
defaultParam: DefaultName,
options?: DataBoundariesGetScopeOptionalParams,
): Promise<DataBoundariesGetScopeResponse>;
}

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

@ -0,0 +1,9 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
export * from "./dataBoundaries";

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

@ -0,0 +1,68 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/
import {
env,
Recorder,
RecorderStartOptions,
delay,
isPlaybackMode,
} from "@azure-tools/test-recorder";
import { createTestCredential } from "@azure-tools/test-credential";
import { assert } from "chai";
import { Context } from "mocha";
import { DataboundariesManegementClient } from "../src/databoundariesManegementClient";
const replaceableVariables: Record<string, string> = {
SUBSCRIPTION_ID: "88888888-8888-8888-8888-888888888888"
};
const recorderOptions: RecorderStartOptions = {
envSetupForPlayback: replaceableVariables,
removeCentralSanitizers: [
"AZSDK3493", // .name in the body is not a secret and is listed below in the beforeEach section
"AZSDK3430", // .id in the body is not a secret and is listed below in the beforeEach section
],
};
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};
describe("DataBoundary test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: DataboundariesManegementClient;
let location: string;
let resourceGroup: string;
let resourcename: string;
beforeEach(async function (this: Context) {
recorder = new Recorder(this.currentTest);
await recorder.start(recorderOptions);
subscriptionId = env.SUBSCRIPTION_ID || '';
// This is an example of how the environment variables are used
const credential = createTestCredential();
client = new DataboundariesManegementClient(credential, recorder.configureClientOptions({}));
location = "eastus";
resourceGroup = "myjstest";
resourcename = "resourcetest";
});
afterEach(async function () {
await recorder.stop();
});
it("dataBoundaries get test", async function () {
const scope =
"subscriptions/" + subscriptionId + "/resourcegroups/myjstest";
const result = await client.dataBoundaries.getScope(scope, "default");
console.log(result);
});
})

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

@ -0,0 +1,33 @@
{
"compilerOptions": {
"module": "es6",
"moduleResolution": "node",
"strict": true,
"target": "es6",
"sourceMap": true,
"declarationMap": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"lib": [
"es6",
"dom"
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-databoundaries": [
"./src/index"
]
}
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
],
"exclude": [
"node_modules"
]
}

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

@ -0,0 +1,38 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/databoundaries/arm-databoundaries
- sdk/databoundaries/ci.mgmt.yml
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
exclude:
- feature/v4
paths:
include:
- sdk/databoundaries/arm-databoundaries
- sdk/databoundaries/ci.mgmt.yml
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: databoundaries
Artifacts:
- name: azure-arm-databoundaries
safeName: azurearmdataboundaries