Skip to content

Commit b0dc8ee

Browse files
author
SDKAuto
committed
CodeGen from PR 14638 in Azure/azure-rest-api-specs
Merge 4b1e09286c6a22a4681f206171a07a5de128ec3f into 18b54ea5e241eddd47527a166c38ed75958b3227
1 parent cec69b6 commit b0dc8ee

32 files changed

+6104
-8120
lines changed

sdk/compute/arm-compute/README.md

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This package contains an isomorphic SDK (runs both in node.js and in browsers) f
55
### Currently supported environments
66

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

1010
### Prerequisites
1111

@@ -14,18 +14,15 @@ You must have an [Azure subscription](https://azure.microsoft.com/free/).
1414
### How to install
1515

1616
To use this SDK in your project, you will need to install two packages.
17-
1817
- `@azure/arm-compute` that contains the client.
1918
- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
2019

2120
Install both packages using the below command:
22-
2321
```bash
2422
npm install --save @azure/arm-compute @azure/identity
2523
```
26-
2724
> **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.
28-
> 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.
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.
2926

3027
### How to use
3128

@@ -39,7 +36,6 @@ npm install --save @azure/arm-compute @azure/identity
3936

4037
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
4138
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.
42-
4339
#### nodejs - Authentication, client creation, and list operations as an example written in JavaScript.
4440

4541
##### Sample code
@@ -53,24 +49,20 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
5349
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
5450
const creds = new DefaultAzureCredential();
5551
const client = new ComputeManagementClient(creds, subscriptionId);
56-
client.operations
57-
.list()
58-
.then((result) => {
59-
console.log("The result is:");
60-
console.log(result);
61-
})
62-
.catch((err) => {
63-
console.log("An error occurred:");
64-
console.error(err);
65-
});
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+
});
6659
```
6760

6861
#### browser - Authentication, client creation, and list operations as an example written in JavaScript.
6962

7063
In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
71-
72-
- 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.
73-
- Note down the client Id from the previous step and use it in the browser sample below.
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.
7466

7567
##### Sample code
7668

@@ -88,21 +80,19 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
8880
const subscriptionId = "<Subscription_Id>";
8981
// Create credentials using the `@azure/identity` package.
9082
// Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
91-
const credential = new InteractiveBrowserCredential({
83+
const credential = new InteractiveBrowserCredential(
84+
{
9285
clientId: "<client id for your Azure AD app>",
9386
tenant: "<optional tenant for your organization>"
9487
});
9588
const client = new Azure.ArmCompute.ComputeManagementClient(creds, subscriptionId);
96-
client.operations
97-
.list()
98-
.then((result) => {
99-
console.log("The result is:");
100-
console.log(result);
101-
})
102-
.catch((err) => {
103-
console.log("An error occurred:");
104-
console.error(err);
105-
});
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+
});
10696
</script>
10797
</head>
10898
<body></body>

sdk/compute/arm-compute/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"rollup-plugin-sourcemaps": "^0.4.2",
2828
"uglify-js": "^3.6.0"
2929
},
30-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute",
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/compute/arm-compute",
3131
"repository": {
3232
"type": "git",
3333
"url": "https://github.com/Azure/azure-sdk-for-js.git"

sdk/compute/arm-compute/src/computeManagementClient.ts

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import * as Mappers from "./models/mappers";
1414
import * as operations from "./operations";
1515
import { ComputeManagementClientContext } from "./computeManagementClientContext";
1616

17+
1718
class ComputeManagementClient extends ComputeManagementClientContext {
1819
// Operation groups
1920
operations: operations.Operations;
@@ -73,11 +74,7 @@ class ComputeManagementClient extends ComputeManagementClientContext {
7374
* subscription. The subscription ID forms part of the URI for every service call.
7475
* @param [options] The parameter options
7576
*/
76-
constructor(
77-
credentials: msRest.ServiceClientCredentials | TokenCredential,
78-
subscriptionId: string,
79-
options?: Models.ComputeManagementClientOptions
80-
) {
77+
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ComputeManagementClientOptions) {
8178
super(credentials, subscriptionId, options);
8279
this.operations = new operations.Operations(this);
8380
this.availabilitySets = new operations.AvailabilitySets(this);
@@ -97,18 +94,12 @@ class ComputeManagementClient extends ComputeManagementClientContext {
9794
this.restorePointCollections = new operations.RestorePointCollections(this);
9895
this.restorePoints = new operations.RestorePoints(this);
9996
this.virtualMachineScaleSetExtensions = new operations.VirtualMachineScaleSetExtensions(this);
100-
this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(
101-
this
102-
);
103-
this.virtualMachineScaleSetVMExtensions = new operations.VirtualMachineScaleSetVMExtensions(
104-
this
105-
);
97+
this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(this);
98+
this.virtualMachineScaleSetVMExtensions = new operations.VirtualMachineScaleSetVMExtensions(this);
10699
this.virtualMachineScaleSetVMs = new operations.VirtualMachineScaleSetVMs(this);
107100
this.logAnalytics = new operations.LogAnalytics(this);
108101
this.virtualMachineRunCommands = new operations.VirtualMachineRunCommands(this);
109-
this.virtualMachineScaleSetVMRunCommands = new operations.VirtualMachineScaleSetVMRunCommands(
110-
this
111-
);
102+
this.virtualMachineScaleSetVMRunCommands = new operations.VirtualMachineScaleSetVMRunCommands(this);
112103
this.resourceSkus = new operations.ResourceSkus(this);
113104
this.disks = new operations.Disks(this);
114105
this.snapshots = new operations.Snapshots(this);

sdk/compute/arm-compute/src/computeManagementClientContext.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@ export class ComputeManagementClientContext extends msRestAzure.AzureServiceClie
3131
* subscription. The subscription ID forms part of the URI for every service call.
3232
* @param [options] The parameter options
3333
*/
34-
constructor(
35-
credentials: msRest.ServiceClientCredentials | TokenCredential,
36-
subscriptionId: string,
37-
options?: Models.ComputeManagementClientOptions
38-
) {
34+
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ComputeManagementClientOptions) {
3935
if (credentials == undefined) {
40-
throw new Error("'credentials' cannot be null.");
36+
throw new Error('\'credentials\' cannot be null.');
4137
}
4238
if (subscriptionId == undefined) {
43-
throw new Error("'subscriptionId' cannot be null.");
39+
throw new Error('\'subscriptionId\' cannot be null.');
4440
}
4541

4642
if (!options) {
@@ -53,7 +49,7 @@ export class ComputeManagementClientContext extends msRestAzure.AzureServiceClie
5349

5450
super(credentials, options);
5551

56-
this.acceptLanguage = "en-US";
52+
this.acceptLanguage = 'en-US';
5753
this.longRunningOperationRetryTimeout = 30;
5854
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
5955
this.requestContentType = "application/json; charset=utf-8";
@@ -63,10 +59,7 @@ export class ComputeManagementClientContext extends msRestAzure.AzureServiceClie
6359
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
6460
this.acceptLanguage = options.acceptLanguage;
6561
}
66-
if (
67-
options.longRunningOperationRetryTimeout !== null &&
68-
options.longRunningOperationRetryTimeout !== undefined
69-
) {
62+
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
7063
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
7164
}
7265
}

sdk/compute/arm-compute/src/models/diskRestorePointOperationsMappers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
*/
88

99
export {
10+
AccessUri,
1011
ApiError,
1112
ApiErrorBase,
1213
CloudError,
1314
DiskRestorePoint,
1415
DiskRestorePointList,
1516
Encryption,
17+
GrantAccessData,
1618
InnerError,
1719
ProxyOnlyResource,
1820
PurchasePlan

0 commit comments

Comments
 (0)