@azure/arm-loadtesting 1.0.1-alpha.20241213.1 → 1.0.1-alpha.20241218.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ LoadTest client provides access to LoadTest Resource and it's status operations.
|
|
|
6
6
|
|
|
7
7
|
[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/loadtesting/arm-loadtesting) |
|
|
8
8
|
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-loadtesting) |
|
|
9
|
-
[API reference documentation](https://
|
|
9
|
+
[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-loadtesting) |
|
|
10
10
|
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)
|
|
11
11
|
|
|
12
12
|
## Getting started
|
|
@@ -46,7 +46,7 @@ npm install @azure/identity
|
|
|
46
46
|
You will also need to **register a new AAD application and grant access to Azure LoadTest** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
|
|
47
47
|
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`.
|
|
48
48
|
|
|
49
|
-
For more information about how to create an Azure AD Application check out [this guide](https://
|
|
49
|
+
For more information about how to create an Azure AD Application check out [this guide](https://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
|
|
50
50
|
|
|
51
51
|
```javascript
|
|
52
52
|
const { LoadTestClient } = require("@azure/arm-loadtesting");
|
|
@@ -67,44 +67,48 @@ const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);
|
|
|
67
67
|
### Create an Azure Load Testing resource
|
|
68
68
|
|
|
69
69
|
Create a new Azure Load Testing resource.
|
|
70
|
+
|
|
70
71
|
```javascript
|
|
71
72
|
loadTestResourceCreatePayload = {
|
|
72
|
-
location: "westus2"
|
|
73
|
+
location: "westus2",
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
const resource = await client.loadTests.beginCreateOrUpdateAndWait(
|
|
76
77
|
"sample-rg",
|
|
77
78
|
"sample-loadtesting-resource",
|
|
78
|
-
loadTestResourceCreatePayload
|
|
79
|
+
loadTestResourceCreatePayload,
|
|
79
80
|
);
|
|
80
81
|
|
|
81
82
|
console.log(resource);
|
|
82
83
|
```
|
|
83
84
|
|
|
84
85
|
Create a new Azure Load Testing resource with managed identity and customer managed key encryption.
|
|
86
|
+
|
|
85
87
|
```javascript
|
|
86
88
|
loadTestResourceCreatePayload = {
|
|
87
89
|
location: "westus2",
|
|
88
90
|
tags: { team: "testing" },
|
|
89
91
|
identity: {
|
|
90
|
-
type:
|
|
92
|
+
type: "SystemAssigned, UserAssigned",
|
|
91
93
|
userAssignedIdentities: {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1":
|
|
95
|
+
{},
|
|
96
|
+
},
|
|
94
97
|
},
|
|
95
98
|
encryption: {
|
|
96
99
|
identity: {
|
|
97
|
-
type:
|
|
98
|
-
resourceId:
|
|
100
|
+
type: "UserAssigned",
|
|
101
|
+
resourceId:
|
|
102
|
+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1",
|
|
99
103
|
},
|
|
100
|
-
keyUrl:
|
|
101
|
-
}
|
|
104
|
+
keyUrl: "https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde",
|
|
105
|
+
},
|
|
102
106
|
};
|
|
103
107
|
|
|
104
108
|
const resource = await client.loadTests.beginCreateOrUpdateAndWait(
|
|
105
109
|
"sample-rg",
|
|
106
110
|
"sample-loadtesting-resource",
|
|
107
|
-
loadTestResourceCreatePayload
|
|
111
|
+
loadTestResourceCreatePayload,
|
|
108
112
|
);
|
|
109
113
|
|
|
110
114
|
console.log(resource);
|
|
@@ -113,13 +117,10 @@ console.log(resource);
|
|
|
113
117
|
### Get an Azure Load Testing resource
|
|
114
118
|
|
|
115
119
|
```javascript
|
|
116
|
-
let resourceName =
|
|
117
|
-
let resourceGroupName =
|
|
120
|
+
let resourceName = "sample-loadtesting-resource";
|
|
121
|
+
let resourceGroupName = "sample-rg";
|
|
118
122
|
|
|
119
|
-
const resource = await client.loadTests.get(
|
|
120
|
-
resourceGroupName,
|
|
121
|
-
resourceName
|
|
122
|
-
);
|
|
123
|
+
const resource = await client.loadTests.get(resourceGroupName, resourceName);
|
|
123
124
|
|
|
124
125
|
console.log(resource);
|
|
125
126
|
```
|
|
@@ -130,27 +131,29 @@ console.log(resource);
|
|
|
130
131
|
loadTestResourcePatchPayload = {
|
|
131
132
|
tags: { team: "testing-dev" },
|
|
132
133
|
identity: {
|
|
133
|
-
type:
|
|
134
|
+
type: "SystemAssigned, UserAssigned",
|
|
134
135
|
userAssignedIdentities: {
|
|
135
136
|
// removing a user-assigned managed identity by assigning the value in the payload as null
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1":
|
|
138
|
+
null,
|
|
139
|
+
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity2":
|
|
140
|
+
{},
|
|
141
|
+
},
|
|
139
142
|
},
|
|
140
143
|
encryption: {
|
|
141
144
|
// use system-assigned managed identity for CMK encryption
|
|
142
145
|
identity: {
|
|
143
|
-
type:
|
|
144
|
-
resourceId: null
|
|
146
|
+
type: "SystemAssigned",
|
|
147
|
+
resourceId: null,
|
|
145
148
|
},
|
|
146
|
-
keyUrl:
|
|
147
|
-
}
|
|
149
|
+
keyUrl: "https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde",
|
|
150
|
+
},
|
|
148
151
|
};
|
|
149
152
|
|
|
150
153
|
const resource = await client.loadTests.beginUpdateAndWait(
|
|
151
154
|
"sample-rg",
|
|
152
155
|
"sample-loadtesting-resource",
|
|
153
|
-
loadTestResourcePatchPayload
|
|
156
|
+
loadTestResourcePatchPayload,
|
|
154
157
|
);
|
|
155
158
|
|
|
156
159
|
console.log(resource);
|
|
@@ -159,16 +162,14 @@ console.log(resource);
|
|
|
159
162
|
### Delete an Azure Load Testing resource
|
|
160
163
|
|
|
161
164
|
```javascript
|
|
162
|
-
let resourceName =
|
|
163
|
-
let resourceGroupName =
|
|
165
|
+
let resourceName = "sample-loadtesting-resource";
|
|
166
|
+
let resourceGroupName = "sample-rg";
|
|
164
167
|
|
|
165
|
-
const result = await client.loadTests.beginDeleteAndWait(
|
|
166
|
-
resourceGroupName,
|
|
167
|
-
resourceName
|
|
168
|
-
);
|
|
168
|
+
const result = await client.loadTests.beginDeleteAndWait(resourceGroupName, resourceName);
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
### JavaScript Bundle
|
|
172
|
+
|
|
172
173
|
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).
|
|
173
174
|
|
|
174
175
|
## Key concepts
|
|
@@ -204,7 +205,7 @@ If you'd like to contribute to this library, please read the [contributing guide
|
|
|
204
205
|
|
|
205
206
|

|
|
206
207
|
|
|
207
|
-
[azure_cli]: https://
|
|
208
|
+
[azure_cli]: https://learn.microsoft.com/cli/azure
|
|
208
209
|
[azure_sub]: https://azure.microsoft.com/free/
|
|
209
210
|
[azure_sub]: https://azure.microsoft.com/free/
|
|
210
211
|
[azure_portal]: https://portal.azure.com
|