Skip to content

Commit eb151ff

Browse files
author
SDKAuto
committed
CodeGen from PR 14687 in Azure/azure-rest-api-specs
Merge 757409f42a0d5f527fc91ea9e103bd568c70168c into a252633188c5e02c4071cc1c3b5cead249db8a54
1 parent 8d9983e commit eb151ff

File tree

251 files changed

+48094
-12859
lines changed

Some content is hidden

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

251 files changed

+48094
-12859
lines changed

sdk/sql/arm-sql/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2019 Microsoft
3+
Copyright (c) 2021 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

sdk/sql/arm-sql/README.md

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,103 @@
11
## Azure SqlManagementClient SDK for JavaScript
22

3-
This package contains an isomorphic SDK for SqlManagementClient.
3+
This package contains an isomorphic SDK (runs both in node.js and in browsers) for SqlManagementClient.
44

55
### Currently supported environments
66

7-
- Node.js version 6.x.x or higher
7+
- Node.js version 8.x.x or higher
88
- Browser JavaScript
99

10-
### How to Install
10+
### Prerequisites
1111

12+
You must have an [Azure subscription](https://azure.microsoft.com/free/).
13+
14+
### How to install
15+
16+
To use this SDK in your project, you will need to install two packages.
17+
- `@azure/arm-sql` that contains the client.
18+
- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
19+
20+
Install both packages using the below command:
1221
```bash
13-
npm install @azure/arm-sql
22+
npm install --save @azure/arm-sql @azure/identity
1423
```
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.
1526

1627
### How to use
1728

18-
#### nodejs - Authentication, client creation and get recoverableDatabases as an example written in TypeScript.
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.
1936

20-
##### Install @azure/ms-rest-nodeauth
21-
22-
- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.
23-
```bash
24-
npm install @azure/ms-rest-nodeauth@"^3.0.0"
25-
```
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 get recoverableDatabases as an example written in JavaScript.
2640

2741
##### Sample code
2842

29-
```typescript
30-
import * as msRest from "@azure/ms-rest-js";
31-
import * as msRestAzure from "@azure/ms-rest-azure-js";
32-
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
33-
import { SqlManagementClient, SqlManagementModels, SqlManagementMappers } from "@azure/arm-sql";
43+
```javascript
44+
const { DefaultAzureCredential } = require("@azure/identity");
45+
const { SqlManagementClient } = require("@azure/arm-sql");
3446
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
3547

36-
msRestNodeAuth.interactiveLogin().then((creds) => {
37-
const client = new SqlManagementClient(creds, subscriptionId);
38-
const resourceGroupName = "testresourceGroupName";
39-
const serverName = "testserverName";
40-
const databaseName = "testdatabaseName";
41-
client.recoverableDatabases.get(resourceGroupName, serverName, databaseName).then((result) => {
42-
console.log("The result is:");
43-
console.log(result);
44-
});
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 SqlManagementClient(creds, subscriptionId);
52+
const resourceGroupName = "testresourceGroupName";
53+
const serverName = "testserverName";
54+
const databaseName = "testdatabaseName";
55+
client.recoverableDatabases.get(resourceGroupName, serverName, databaseName).then((result) => {
56+
console.log("The result is:");
57+
console.log(result);
4558
}).catch((err) => {
59+
console.log("An error occurred:");
4660
console.error(err);
4761
});
4862
```
4963

50-
#### browser - Authentication, client creation and get recoverableDatabases as an example written in JavaScript.
64+
#### browser - Authentication, client creation, and get recoverableDatabases as an example written in JavaScript.
5165

52-
##### Install @azure/ms-rest-browserauth
53-
54-
```bash
55-
npm install @azure/ms-rest-browserauth
56-
```
66+
In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
67+
- 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.
68+
- Note down the client Id from the previous step and use it in the browser sample below.
5769

5870
##### Sample code
5971

60-
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
61-
6272
- index.html
73+
6374
```html
6475
<!DOCTYPE html>
6576
<html lang="en">
6677
<head>
6778
<title>@azure/arm-sql sample</title>
68-
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script>
6979
<script src="node_modules/@azure/ms-rest-azure-js/dist/msRestAzure.js"></script>
70-
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script>
80+
<script src="node_modules/@azure/identity/dist/index.js"></script>
7181
<script src="node_modules/@azure/arm-sql/dist/arm-sql.js"></script>
7282
<script type="text/javascript">
7383
const subscriptionId = "<Subscription_Id>";
74-
const authManager = new msAuth.AuthManager({
84+
// Create credentials using the `@azure/identity` package.
85+
// Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
86+
const credential = new InteractiveBrowserCredential(
87+
{
7588
clientId: "<client id for your Azure AD app>",
7689
tenant: "<optional tenant for your organization>"
7790
});
78-
authManager.finalizeLogin().then((res) => {
79-
if (!res.isLoggedIn) {
80-
// may cause redirects
81-
authManager.login();
82-
}
83-
const client = new Azure.ArmSql.SqlManagementClient(res.creds, subscriptionId);
84-
const resourceGroupName = "testresourceGroupName";
85-
const serverName = "testserverName";
86-
const databaseName = "testdatabaseName";
87-
client.recoverableDatabases.get(resourceGroupName, serverName, databaseName).then((result) => {
88-
console.log("The result is:");
89-
console.log(result);
90-
}).catch((err) => {
91-
console.log("An error occurred:");
92-
console.error(err);
93-
});
91+
const client = new Azure.ArmSql.SqlManagementClient(creds, subscriptionId);
92+
const resourceGroupName = "testresourceGroupName";
93+
const serverName = "testserverName";
94+
const databaseName = "testdatabaseName";
95+
client.recoverableDatabases.get(resourceGroupName, serverName, databaseName).then((result) => {
96+
console.log("The result is:");
97+
console.log(result);
98+
}).catch((err) => {
99+
console.log("An error occurred:");
100+
console.error(err);
94101
});
95102
</script>
96103
</head>

sdk/sql/arm-sql/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"description": "SqlManagementClient Library with typescript type definitions for node.js and browser.",
55
"version": "7.0.2",
66
"dependencies": {
7-
"@azure/ms-rest-azure-js": "^2.0.1",
8-
"@azure/ms-rest-js": "^2.0.4",
7+
"@azure/ms-rest-azure-js": "^2.1.0",
8+
"@azure/ms-rest-js": "^2.2.0",
9+
"@azure/core-auth": "^1.1.4",
910
"tslib": "^1.10.0"
1011
},
1112
"keywords": [
@@ -20,7 +21,7 @@
2021
"module": "./esm/sqlManagementClient.js",
2122
"types": "./esm/sqlManagementClient.d.ts",
2223
"devDependencies": {
23-
"typescript": "^3.5.3",
24+
"typescript": "^3.6.0",
2425
"rollup": "^1.18.0",
2526
"rollup-plugin-node-resolve": "^5.2.0",
2627
"rollup-plugin-sourcemaps": "^0.4.2",

sdk/sql/arm-sql/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const config = {
2121
"@azure/ms-rest-azure-js": "msRestAzure"
2222
},
2323
banner: `/*
24-
* Copyright (c) Microsoft Corporation. All rights reserved.
25-
* Licensed under the MIT License. See License.txt in the project root for license information.
24+
* Copyright (c) Microsoft Corporation.
25+
* Licensed under the MIT License.
2626
*
2727
* Code generated by Microsoft (R) AutoRest Code Generator.
2828
* Changes may cause incorrect behavior and will be lost if the code is regenerated.

sdk/sql/arm-sql/src/models/backupShortTermRetentionPoliciesMappers.ts

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
/*
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for license information.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
44
*
55
* Code generated by Microsoft (R) AutoRest Code Generator.
66
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
*/
88

99
export {
10+
Advisor,
1011
AutomaticTuningOptions,
1112
AutomaticTuningServerOptions,
12-
BackupLongTermRetentionPolicy,
1313
BackupShortTermRetentionPolicy,
1414
BackupShortTermRetentionPolicyListResult,
1515
BaseResource,
1616
CloudError,
1717
Database,
1818
DatabaseAutomaticTuning,
1919
DatabaseBlobAuditingPolicy,
20+
DatabaseColumn,
21+
DatabaseExtensions,
2022
DatabaseOperation,
23+
DatabaseSchema,
2124
DatabaseSecurityAlertPolicy,
25+
DatabaseTable,
26+
DatabaseUsage,
2227
DatabaseVulnerabilityAssessment,
2328
DatabaseVulnerabilityAssessmentRuleBaseline,
2429
DatabaseVulnerabilityAssessmentRuleBaselineItem,
2530
DatabaseVulnerabilityAssessmentScansExport,
2631
DataMaskingPolicy,
2732
DataMaskingRule,
33+
DataWarehouseUserActivities,
34+
DeletedServer,
2835
ElasticPool,
2936
ElasticPoolActivity,
3037
ElasticPoolDatabaseActivity,
@@ -38,7 +45,8 @@ export {
3845
FailoverGroupReadWriteEndpoint,
3946
FirewallRule,
4047
GeoBackupPolicy,
41-
ImportExportResponse,
48+
ImportExportExtensionsOperationResult,
49+
ImportExportOperationResult,
4250
InstanceFailoverGroup,
4351
InstanceFailoverGroupReadOnlyEndpoint,
4452
InstanceFailoverGroupReadWriteEndpoint,
@@ -56,53 +64,96 @@ export {
5664
JobTarget,
5765
JobTargetGroup,
5866
JobVersion,
67+
LedgerDigestUploads,
5968
LongTermRetentionBackup,
69+
LongTermRetentionBackupOperationResult,
70+
LongTermRetentionPolicy,
71+
MaintenanceWindowOptions,
72+
MaintenanceWindows,
73+
MaintenanceWindowTimeRange,
6074
ManagedBackupShortTermRetentionPolicy,
6175
ManagedDatabase,
6276
ManagedDatabaseRestoreDetailsResult,
6377
ManagedDatabaseSecurityAlertPolicy,
6478
ManagedInstance,
6579
ManagedInstanceAdministrator,
80+
ManagedInstanceAzureADOnlyAuthentication,
6681
ManagedInstanceEncryptionProtector,
82+
ManagedInstanceExternalAdministrator,
6783
ManagedInstanceKey,
84+
ManagedInstanceLongTermRetentionBackup,
85+
ManagedInstanceLongTermRetentionPolicy,
86+
ManagedInstanceOperation,
87+
ManagedInstanceOperationParametersPair,
88+
ManagedInstanceOperationSteps,
6889
ManagedInstancePairInfo,
90+
ManagedInstancePecProperty,
91+
ManagedInstancePrivateEndpointConnection,
92+
ManagedInstancePrivateEndpointConnectionProperties,
93+
ManagedInstancePrivateEndpointProperty,
94+
ManagedInstancePrivateLink,
95+
ManagedInstancePrivateLinkProperties,
96+
ManagedInstancePrivateLinkServiceConnectionStateProperty,
97+
ManagedInstanceQuery,
6998
ManagedInstanceVulnerabilityAssessment,
7099
ManagedServerSecurityAlertPolicy,
71-
OperationImpact,
100+
ManagedTransparentDataEncryption,
101+
OperationsHealth,
102+
OutboundFirewallRule,
72103
PartnerInfo,
73104
PartnerRegionInfo,
74105
PrivateEndpointConnection,
106+
PrivateEndpointConnectionProperties,
107+
PrivateEndpointConnectionRequestStatus,
75108
PrivateEndpointProperty,
76109
PrivateLinkResource,
77110
PrivateLinkResourceProperties,
78111
PrivateLinkServiceConnectionStateProperty,
79112
ProxyResource,
80-
RecommendedElasticPool,
81-
RecommendedElasticPoolMetric,
82-
RecommendedIndex,
113+
ProxyResourceWithWritableName,
114+
QueryMetricInterval,
115+
QueryMetricProperties,
116+
QueryStatistics,
117+
RecommendedAction,
118+
RecommendedActionErrorInfo,
119+
RecommendedActionImpactRecord,
120+
RecommendedActionImplementationInfo,
121+
RecommendedActionMetricInfo,
122+
RecommendedActionStateInfo,
123+
RecommendedSensitivityLabelUpdate,
83124
RecoverableDatabase,
84125
RecoverableManagedDatabase,
85126
ReplicationLink,
86127
Resource,
87128
ResourceIdentity,
129+
ResourceWithWritableName,
88130
RestorableDroppedDatabase,
89131
RestorableDroppedManagedDatabase,
90132
RestorePoint,
133+
SecurityEvent,
134+
SecurityEventSqlInjectionAdditionalProperties,
91135
SensitivityLabel,
136+
SensitivityLabelUpdate,
92137
Server,
93138
ServerAutomaticTuning,
94139
ServerAzureADAdministrator,
140+
ServerAzureADOnlyAuthentication,
95141
ServerBlobAuditingPolicy,
96142
ServerCommunicationLink,
97143
ServerConnectionPolicy,
144+
ServerDevOpsAuditingSettings,
98145
ServerDnsAlias,
146+
ServerExternalAdministrator,
147+
ServerInfo,
99148
ServerKey,
149+
ServerOperation,
150+
ServerPrivateEndpointConnection,
100151
ServerSecurityAlertPolicy,
152+
ServerTrustGroup,
101153
ServerVulnerabilityAssessment,
102154
ServiceObjective,
103-
ServiceTierAdvisor,
104155
Sku,
105-
SloUsageMetric,
156+
SqlAgentConfiguration,
106157
SubscriptionUsage,
107158
SyncAgent,
108159
SyncAgentLinkedDatabase,
@@ -111,13 +162,21 @@ export {
111162
SyncGroupSchemaTable,
112163
SyncGroupSchemaTableColumn,
113164
SyncMember,
165+
SystemData,
114166
TdeCertificate,
167+
TimeZone,
115168
TrackedResource,
116169
TransparentDataEncryption,
117170
TransparentDataEncryptionActivity,
171+
UpdateManagedInstanceDnsServersOperation,
172+
UpsertManagedServerOperationParameters,
173+
UpsertManagedServerOperationStep,
174+
UserIdentity,
118175
VirtualCluster,
119176
VirtualNetworkRule,
120177
VulnerabilityAssessmentRecurringScansProperties,
121178
VulnerabilityAssessmentScanError,
122-
VulnerabilityAssessmentScanRecord
179+
VulnerabilityAssessmentScanRecord,
180+
WorkloadClassifier,
181+
WorkloadGroup
123182
} from "../models/mappers";

0 commit comments

Comments
 (0)