@azure/arm-loadtesting 1.0.0-beta.1 → 1.0.0-beta.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
-
2
+
3
+ ## 1.0.0-beta.2 (2023-01-06)
4
+
5
+ **Features**
6
+
7
+ -bugs Fixed
8
+
3
9
  ## 1.0.0-beta.1 (2022-11-24)
4
10
 
5
11
  The package of @azure/arm-loadtesting is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Azure LoadTest client library for JavaScript
1
+ # Azure Load Testing client library for JavaScript
2
2
 
3
3
  This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure LoadTest client.
4
4
 
@@ -64,6 +64,109 @@ const client = new LoadTestClient(new DefaultAzureCredential(), subscriptionId);
64
64
  // const client = new LoadTestClient(credential, subscriptionId);
65
65
  ```
66
66
 
67
+ ### Create an Azure Load Testing resource
68
+
69
+ Create a new Azure Load Testing resource.
70
+ ```javascript
71
+ loadTestResourceCreatePayload = {
72
+ location: "westus2"
73
+ };
74
+
75
+ const resource = await client.loadTests.beginCreateOrUpdateAndWait(
76
+ "sample-rg",
77
+ "sample-loadtesting-resource",
78
+ loadTestResourceCreatePayload
79
+ );
80
+
81
+ console.log(resource);
82
+ ```
83
+
84
+ Create a new Azure Load Testing resource with managed identity and customer managed key encryption.
85
+ ```javascript
86
+ loadTestResourceCreatePayload = {
87
+ location: "westus2",
88
+ tags: { team: "testing" },
89
+ identity: {
90
+ type: 'SystemAssigned, UserAssigned',
91
+ userAssignedIdentities: {
92
+ '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1': {}
93
+ }
94
+ },
95
+ encryption: {
96
+ identity: {
97
+ type: 'UserAssigned',
98
+ resourceId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1'
99
+ },
100
+ keyUrl: 'https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde'
101
+ }
102
+ };
103
+
104
+ const resource = await client.loadTests.beginCreateOrUpdateAndWait(
105
+ "sample-rg",
106
+ "sample-loadtesting-resource",
107
+ loadTestResourceCreatePayload
108
+ );
109
+
110
+ console.log(resource);
111
+ ```
112
+
113
+ ### Get an Azure Load Testing resource
114
+
115
+ ```javascript
116
+ let resourceName = 'sample-loadtesting-resource';
117
+ let resourceGroupName = 'sample-rg';
118
+
119
+ const resource = await client.loadTests.get(
120
+ resourceGroupName,
121
+ resourceName
122
+ );
123
+
124
+ console.log(resource);
125
+ ```
126
+
127
+ ### Update an Azure Load Testing resource
128
+
129
+ ```javascript
130
+ loadTestResourcePatchPayload = {
131
+ tags: { team: "testing-dev" },
132
+ identity: {
133
+ type: 'SystemAssigned, UserAssigned',
134
+ userAssignedIdentities: {
135
+ // removing a user-assigned managed identity by assigning the value in the payload as null
136
+ '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity1': null,
137
+ '/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/identity2': {}
138
+ }
139
+ },
140
+ encryption: {
141
+ // use system-assigned managed identity for CMK encryption
142
+ identity: {
143
+ type: 'SystemAssigned',
144
+ resourceId: null
145
+ },
146
+ keyUrl: 'https://sample-kv.vault.azure.net/keys/cmkkey/2d1ccd5c50234ea2a0858fe148b69cde'
147
+ }
148
+ };
149
+
150
+ const resource = await client.loadTests.beginUpdateAndWait(
151
+ "sample-rg",
152
+ "sample-loadtesting-resource",
153
+ loadTestResourcePatchPayload
154
+ );
155
+
156
+ console.log(resource);
157
+ ```
158
+
159
+ ### Delete an Azure Load Testing resource
160
+
161
+ ```javascript
162
+ let resourceName = 'sample-loadtesting-resource';
163
+ let resourceGroupName = 'sample-rg';
164
+
165
+ const result = await client.loadTests.beginDeleteAndWait(
166
+ resourceGroupName,
167
+ resourceName
168
+ );
169
+ ```
67
170
 
68
171
  ### JavaScript Bundle
69
172
  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).
package/dist/index.js CHANGED
@@ -2136,7 +2136,7 @@ class LoadTestClient extends coreClient__namespace.ServiceClient {
2136
2136
  requestContentType: "application/json; charset=utf-8",
2137
2137
  credential: credentials
2138
2138
  };
2139
- const packageDetails = `azsdk-js-arm-loadtesting/1.0.0-beta.1`;
2139
+ const packageDetails = `azsdk-js-arm-loadtesting/1.0.0-beta.2`;
2140
2140
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2141
2141
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2142
2142
  : `${packageDetails}`;