Skip to content

Commit 024c860

Browse files
authored
arm-compute-release (Azure#16506)
1 parent 55e66cb commit 024c860

File tree

69 files changed

+8948
-8119
lines changed

Some content is hidden

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

69 files changed

+8948
-8119
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@azure/arm-compute",
33
"author": "Microsoft Corporation",
44
"description": "ComputeManagementClient Library with typescript type definitions for node.js and browser.",
5-
"version": "16.2.0",
5+
"version": "16.3.0",
66
"dependencies": {
77
"@azure/ms-rest-azure-js": "^2.1.0",
88
"@azure/ms-rest-js": "^2.2.0",
@@ -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/feature/v4/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: 9 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;
@@ -33,6 +34,8 @@ class ComputeManagementClient extends ComputeManagementClientContext {
3334
images: operations.Images;
3435
restorePointCollections: operations.RestorePointCollections;
3536
restorePoints: operations.RestorePoints;
37+
capacityReservationGroups: operations.CapacityReservationGroups;
38+
capacityReservations: operations.CapacityReservations;
3639
virtualMachineScaleSetExtensions: operations.VirtualMachineScaleSetExtensions;
3740
virtualMachineScaleSetRollingUpgrades: operations.VirtualMachineScaleSetRollingUpgrades;
3841
virtualMachineScaleSetVMExtensions: operations.VirtualMachineScaleSetVMExtensions;
@@ -73,11 +76,7 @@ class ComputeManagementClient extends ComputeManagementClientContext {
7376
* subscription. The subscription ID forms part of the URI for every service call.
7477
* @param [options] The parameter options
7578
*/
76-
constructor(
77-
credentials: msRest.ServiceClientCredentials | TokenCredential,
78-
subscriptionId: string,
79-
options?: Models.ComputeManagementClientOptions
80-
) {
79+
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.ComputeManagementClientOptions) {
8180
super(credentials, subscriptionId, options);
8281
this.operations = new operations.Operations(this);
8382
this.availabilitySets = new operations.AvailabilitySets(this);
@@ -96,19 +95,15 @@ class ComputeManagementClient extends ComputeManagementClientContext {
9695
this.images = new operations.Images(this);
9796
this.restorePointCollections = new operations.RestorePointCollections(this);
9897
this.restorePoints = new operations.RestorePoints(this);
98+
this.capacityReservationGroups = new operations.CapacityReservationGroups(this);
99+
this.capacityReservations = new operations.CapacityReservations(this);
99100
this.virtualMachineScaleSetExtensions = new operations.VirtualMachineScaleSetExtensions(this);
100-
this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(
101-
this
102-
);
103-
this.virtualMachineScaleSetVMExtensions = new operations.VirtualMachineScaleSetVMExtensions(
104-
this
105-
);
101+
this.virtualMachineScaleSetRollingUpgrades = new operations.VirtualMachineScaleSetRollingUpgrades(this);
102+
this.virtualMachineScaleSetVMExtensions = new operations.VirtualMachineScaleSetVMExtensions(this);
106103
this.virtualMachineScaleSetVMs = new operations.VirtualMachineScaleSetVMs(this);
107104
this.logAnalytics = new operations.LogAnalytics(this);
108105
this.virtualMachineRunCommands = new operations.VirtualMachineRunCommands(this);
109-
this.virtualMachineScaleSetVMRunCommands = new operations.VirtualMachineScaleSetVMRunCommands(
110-
this
111-
);
106+
this.virtualMachineScaleSetVMRunCommands = new operations.VirtualMachineScaleSetVMRunCommands(this);
112107
this.resourceSkus = new operations.ResourceSkus(this);
113108
this.disks = new operations.Disks(this);
114109
this.snapshots = new operations.Snapshots(this);

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as msRestAzure from "@azure/ms-rest-azure-js";
1313
import { TokenCredential } from "@azure/core-auth";
1414

1515
const packageName = "@azure/arm-compute";
16-
const packageVersion = "16.2.0";
16+
const packageVersion = "16.3.0";
1717

1818
export class ComputeManagementClientContext extends msRestAzure.AzureServiceClient {
1919
credentials: msRest.ServiceClientCredentials | TokenCredential;
@@ -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/availabilitySetsMappers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ export {
2323
BillingProfile,
2424
BootDiagnostics,
2525
BootDiagnosticsInstanceView,
26+
CapacityReservation,
27+
CapacityReservationGroup,
28+
CapacityReservationGroupInstanceView,
29+
CapacityReservationGroupUpdate,
30+
CapacityReservationInstanceView,
31+
CapacityReservationInstanceViewWithName,
32+
CapacityReservationProfile,
33+
CapacityReservationUpdate,
34+
CapacityReservationUtilization,
2635
CloudError,
2736
CloudService,
2837
CloudServiceExtensionProfile,
@@ -163,6 +172,7 @@ export {
163172
Snapshot,
164173
SnapshotSku,
165174
SourceVault,
175+
SpotRestorePolicy,
166176
SshConfiguration,
167177
SshPublicKey,
168178
SshPublicKeyResource,

0 commit comments

Comments
 (0)