Skip to content

Commit

Permalink
CodeGen from PR 29708 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 02e0e8c03292fe7ebff0db9e3ca15472aabc87df into c59b222396f95f45efa7a57c1b5a5ae1ac73a9cb
  • Loading branch information
SDKAuto committed Dec 5, 2024
1 parent 4185a24 commit 447cf86
Show file tree
Hide file tree
Showing 150 changed files with 53,082 additions and 10,742 deletions.
6 changes: 4 additions & 2 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

982 changes: 974 additions & 8 deletions sdk/migrate/arm-migrate/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/migrate/arm-migrate/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Microsoft
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
Expand Down
29 changes: 14 additions & 15 deletions sdk/migrate/arm-migrate/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# AzureMigrateV2 client library for JavaScript
# Azure Migrate Discovery client library for JavaScript

This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureMigrateV2 client.
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure Migrate Discovery client.

Assess your workloads for Azure.
Azure OffAzure Resource Provider management API.

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/migrate/arm-migrate) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-migrate) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-migrate) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-migrate?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)

## Getting started
Expand All @@ -24,16 +24,16 @@ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUP

### Install the `@azure/arm-migrate` package

Install the AzureMigrateV2 client library for JavaScript with `npm`:
Install the Azure Migrate Discovery client library for JavaScript with `npm`:

```bash
npm install @azure/arm-migrate
```

### Create and authenticate a `AzureMigrateV2`
### Create and authenticate a `AzureMigrateDiscoveryService`

To create a client object to access the AzureMigrateV2 API, you will need the `endpoint` of your AzureMigrateV2 resource and a `credential`. The AzureMigrateV2 client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your AzureMigrateV2 resource in the [Azure Portal][azure_portal].
To create a client object to access the Azure Migrate Discovery API, you will need the `endpoint` of your Azure Migrate Discovery resource and a `credential`. The Azure Migrate Discovery client can use Azure Active Directory credentials to authenticate.
You can find the endpoint for your Azure Migrate Discovery 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).

Expand All @@ -43,25 +43,24 @@ 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 AzureMigrateV2** 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`.
You will also need to **register a new AAD application and grant access to Azure Migrate Discovery** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).

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 { AzureMigrateV2 } = require("@azure/arm-migrate");
const { AzureMigrateDiscoveryService } = require("@azure/arm-migrate");
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 AzureMigrateV2(new DefaultAzureCredential(), subscriptionId);
const client = new AzureMigrateDiscoveryService(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 AzureMigrateV2(credential, subscriptionId);
// const client = new AzureMigrateDiscoveryService(credential, subscriptionId);
```


Expand All @@ -70,9 +69,9 @@ To use this client library in the browser, first you need to use a bundler. For

## Key concepts

### AzureMigrateV2
### AzureMigrateDiscoveryService

`AzureMigrateV2` is the primary interface for developers using the AzureMigrateV2 client library. Explore the methods on this client object to understand the different features of the AzureMigrateV2 service that you can access.
`AzureMigrateDiscoveryService` is the primary interface for developers using the Azure Migrate Discovery client library. Explore the methods on this client object to understand the different features of the Azure Migrate Discovery service that you can access.

## Troubleshooting

Expand Down
10 changes: 5 additions & 5 deletions sdk/migrate/arm-migrate/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "d967edeee8fd6af6d40bffe53cceed1bd053d7ad",
"readme": "specification\\migrate\\resource-manager\\readme.md",
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\migrate\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true",
"commit": "8d616e91b3c725de64ac4152411909d457cf6f02",
"readme": "specification/migrate/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/migrate/resource-manager/readme.md --use=@autorest/typescript@^6.0.12",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.0",
"use": "@autorest/typescript@6.0.0-rc.7"
"release_tool": "@azure-tools/js-sdk-release-tools@2.7.16",
"use": "@autorest/typescript@^6.0.12"
}
71 changes: 33 additions & 38 deletions sdk/migrate/arm-migrate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@
"name": "@azure/arm-migrate",
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for AzureMigrateV2.",
"version": "2.0.4",
"description": "A generated SDK for AzureMigrateDiscoveryService.",
"version": "3.0.0-beta.1",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@azure/core-auth": "^1.3.0",
"@azure/core-client": "^1.6.1",
"@azure/core-lro": "^2.5.4",
"@azure/abort-controller": "^2.1.2",
"@azure/core-paging": "^1.2.0",
"@azure/core-rest-pipeline": "^1.8.0",
"@azure/core-client": "^1.7.0",
"@azure/core-auth": "^1.6.0",
"@azure/core-rest-pipeline": "^1.14.0",
"tslib": "^2.2.0"
},
"keywords": [
Expand All @@ -26,18 +28,19 @@
"module": "./dist-esm/src/index.js",
"types": "./types/arm-migrate.d.ts",
"devDependencies": {
"@azure-tools/test-credential": "^1.0.0",
"@azure-tools/test-recorder": "^3.0.0",
"typescript": "~5.6.2",
"dotenv": "^16.0.0",
"@azure/dev-tool": "^1.0.0",
"@azure/identity": "^4.0.1",
"@types/chai": "^4.2.8",
"@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",
"@types/node": "^18.0.0",
"tsx": "^4.7.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"dotenv": "^16.0.0",
"mocha": "^10.0.0",
"ts-node": "^10.0.0",
"typescript": "~5.6.2"
"@types/node": "^18.0.0",
"ts-node": "^10.0.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -65,47 +68,39 @@
],
"scripts": {
"build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api",
"build:browser": "echo skipped",
"minify": "dev-tool run vendored 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": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"build:node": "echo skipped",
"build:samples": "echo skipped.",
"build:browser": "echo skipped",
"build:test": "echo skipped",
"build:samples": "echo skipped.",
"check-format": "echo skipped",
"clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"execute:samples": "echo skipped",
"extract-api": "dev-tool run extract-api",
"format": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:browser": "echo skipped",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"lint": "echo skipped",
"minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
"pack": "npm pack 2>&1",
"prepack": "npm run build",
"test": "npm run integration-test",
"test:browser": "echo skipped",
"test:node": "echo skipped",
"test:browser": "echo skipped",
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
"unit-test:browser": "echo skipped",
"unit-test:node": "dev-tool run vendored 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",
"update-snippets": "echo skipped"
},
"sideEffects": false,
"//metadata": {
"constantPaths": [
{
"path": "src/azureMigrateV2.ts",
"path": "src/azureMigrateDiscoveryService.ts",
"prefix": "packageDetails"
}
]
},
"autoPublish": true,
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/migrate/arm-migrate",
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-migrate?view=azure-node-preview"
}
}
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/migrate/arm-migrate"
}
Loading

0 comments on commit 447cf86

Please sign in to comment.