Skip to content

Commit bdd55fe

Browse files
author
SDKAuto
committed
CodeGen from PR 17157 in Azure/azure-rest-api-specs
Merge 44c10d8df642e9801cc38e95fda27719250f70b7 into 0a6665506efb86dba686aa87cab3bdd836fac36a
1 parent 479234a commit bdd55fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+13413
-7516
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 26 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rush.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,11 @@
12051205
"packageName": "@azure/arm-changeanalysis",
12061206
"projectFolder": "sdk/changeanalysis/arm-changeanalysis",
12071207
"versionPolicyName": "management"
1208+
},
1209+
{
1210+
"packageName": "@azure/arm-netapp",
1211+
"projectFolder": "sdk/netapp/arm-netapp",
1212+
"versionPolicyName": "management"
12081213
}
12091214
]
12101215
}

sdk/netapp/arm-netapp/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Release History
2+
3+
## 15.0.0 (2021-12-31)
4+
5+
The package of @azure/arm-netapp is using our next generation design principles since version 15.0.0, which contains breaking changes.
6+
7+
To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
8+
9+
To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/js-track2-migration-guide).
10+
11+
To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

sdk/netapp/arm-netapp/LICENSE.txt renamed to sdk/netapp/arm-netapp/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

sdk/netapp/arm-netapp/README.md

Lines changed: 71 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,98 @@
1-
## Azure AzureNetAppFilesManagementClient SDK for JavaScript
1+
# Azure NetAppManagement client library for JavaScript
22

3-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AzureNetAppFilesManagementClient.
3+
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure NetAppManagement client.
4+
5+
Microsoft NetApp Files Azure Resource Provider specification
6+
7+
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/netapp/arm-netapp) |
8+
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-netapp) |
9+
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-netapp) |
10+
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
11+
12+
## Getting started
413

514
### Currently supported environments
615

716
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
8-
- Latest versions of Safari, Chrome, Edge, and Firefox.
17+
- Latest versions of Safari, Chrome, Edge and Firefox.
918

1019
### Prerequisites
1120

12-
You must have an [Azure subscription](https://azure.microsoft.com/free/).
21+
- An [Azure subscription][azure_sub].
1322

14-
### How to install
23+
### Install the `@azure/arm-netapp` package
1524

16-
To use this SDK in your project, you will need to install two packages.
17-
- `@azure/arm-netapp` that contains the client.
18-
- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
25+
Install the Azure NetAppManagement client library for JavaScript with `npm`:
1926

20-
Install both packages using the below command:
2127
```bash
22-
npm install --save @azure/arm-netapp @azure/identity
28+
npm install @azure/arm-netapp
2329
```
24-
> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
25-
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
2630

27-
### How to use
31+
### Create and authenticate a `NetAppManagementClient`
32+
33+
To create a client object to access the Azure NetAppManagement API, you will need the `endpoint` of your Azure NetAppManagement resource and a `credential`. The Azure NetAppManagement client can use Azure Active Directory credentials to authenticate.
34+
You can find the endpoint for your Azure NetAppManagement resource in the [Azure Portal][azure_portal].
35+
36+
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).
37+
38+
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package:
2839

29-
- If you are writing a client side browser application,
30-
- Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions.
31-
- Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below.
32-
- If you are writing a server side application,
33-
- [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
34-
- Complete the set up steps required by the credential if any.
35-
- Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below.
40+
```bash
41+
npm install @azure/identity
42+
```
3643

37-
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
38-
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
39-
#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript.
44+
You will also need to **register a new AAD application and grant access to Azure NetAppManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
45+
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`.
4046

41-
##### Sample code
47+
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).
4248

4349
```javascript
50+
const { NetAppManagementClient } = require("@azure/arm-netapp");
4451
const { DefaultAzureCredential } = require("@azure/identity");
45-
const { AzureNetAppFilesManagementClient } = require("@azure/arm-netapp");
46-
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
47-
48-
// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples
49-
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
50-
const creds = new DefaultAzureCredential();
51-
const client = new AzureNetAppFilesManagementClient(creds, subscriptionId);
52-
client.operations.list().then((result) => {
53-
console.log("The result is:");
54-
console.log(result);
55-
}).catch((err) => {
56-
console.log("An error occurred:");
57-
console.error(err);
58-
});
52+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
53+
const client = new NetAppManagementClient(new DefaultAzureCredential(), subscriptionId);
5954
```
6055

61-
#### browser - Authentication, client creation, and list operations as an example written in JavaScript.
62-
63-
In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
64-
- See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
65-
- Note down the client Id from the previous step and use it in the browser sample below.
66-
67-
##### Sample code
68-
69-
- index.html
70-
71-
```html
72-
<!DOCTYPE html>
73-
<html lang="en">
74-
<head>
75-
<title>@azure/arm-netapp sample</title>
76-
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
77-
<script src="node_modules/@azure/identity/dist/index.js"></script>
78-
<script src="node_modules/@azure/arm-netapp/dist/arm-netapp.js"></script>
79-
<script type="text/javascript">
80-
const subscriptionId = "<Subscription_Id>";
81-
// Create credentials using the `@azure/identity` package.
82-
// Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
83-
const credential = new InteractiveBrowserCredential(
84-
{
85-
clientId: "<client id for your Azure AD app>",
86-
tenant: "<optional tenant for your organization>"
87-
});
88-
const client = new Azure.ArmNetapp.AzureNetAppFilesManagementClient(creds, subscriptionId);
89-
client.operations.list().then((result) => {
90-
console.log("The result is:");
91-
console.log(result);
92-
}).catch((err) => {
93-
console.log("An error occurred:");
94-
console.error(err);
95-
});
96-
</script>
97-
</head>
98-
<body></body>
99-
</html>
56+
57+
### JavaScript Bundle
58+
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).
59+
60+
## Key concepts
61+
62+
### NetAppManagementClient
63+
64+
`NetAppManagementClient` is the primary interface for developers using the Azure NetAppManagement client library. Explore the methods on this client object to understand the different features of the Azure NetAppManagement service that you can access.
65+
66+
## Troubleshooting
67+
68+
### Logging
69+
70+
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`:
71+
72+
```javascript
73+
const { setLogLevel } = require("@azure/logger");
74+
setLogLevel("info");
10075
```
10176

77+
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).
78+
79+
## Next steps
80+
81+
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.
82+
83+
## Contributing
84+
85+
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.
86+
10287
## Related projects
10388

104-
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
89+
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
90+
91+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fnetapp%2Farm-netapp%2FREADME.png)
10592

106-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/netapp/arm-netapp/README.png)
93+
[azure_cli]: https://docs.microsoft.com/cli/azure
94+
[azure_sub]: https://azure.microsoft.com/free/
95+
[azure_sub]: https://azure.microsoft.com/free/
96+
[azure_portal]: https://portal.azure.com
97+
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
98+
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential

sdk/netapp/arm-netapp/_meta.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"commit": "0b29412331a76d909c729083702173978ccdffce",
3+
"readme": "specification/netapp/resource-manager/readme.md",
4+
"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=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/netapp/resource-manager/readme.md --use=@autorest/[email protected]",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6+
"use": "@autorest/[email protected]"
7+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
4+
"docModel": { "enabled": true },
5+
"apiReport": { "enabled": true, "reportFolder": "./review" },
6+
"dtsRollup": {
7+
"enabled": true,
8+
"untrimmedFilePath": "",
9+
"publicTrimmedFilePath": "./types/arm-netapp.d.ts"
10+
},
11+
"messages": {
12+
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
13+
"extractorMessageReporting": {
14+
"ae-missing-release-tag": { "logLevel": "none" },
15+
"ae-unresolved-link": { "logLevel": "none" }
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)