Skip to content

Commit ee25c2b

Browse files
authored
hybridkubernetes-track1 (Azure#18095)
1 parent 7c6cfcf commit ee25c2b

File tree

8 files changed

+298
-11
lines changed

8 files changed

+298
-11
lines changed

sdk/hybridkubernetes/arm-hybridkubernetes/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Azure ConnectedKubernetesClient SDK for JavaScript
22

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

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

@@ -21,7 +21,6 @@ Install both packages using the below command:
2121
```bash
2222
npm install --save @azure/arm-hybridkubernetes @azure/identity
2323
```
24-
2524
> **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.
2625
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.
2726

@@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/
3736

3837
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
3938
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.
40-
4139
#### nodejs - Authentication, client creation, and get connectedCluster as an example written in JavaScript.
4240

4341
##### Sample code
@@ -87,7 +85,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
8785
const credential = new InteractiveBrowserCredential(
8886
{
8987
clientId: "<client id for your Azure AD app>",
90-
tenantId: "<optional tenant for your organization>"
88+
tenant: "<optional tenant for your organization>"
9189
});
9290
const client = new Azure.ArmHybridkubernetes.ConnectedKubernetesClient(creds, subscriptionId);
9391
const resourceGroupName = "testresourceGroupName";

sdk/hybridkubernetes/arm-hybridkubernetes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@azure/arm-hybridkubernetes",
33
"author": "Microsoft Corporation",
44
"description": "ConnectedKubernetesClient Library with typescript type definitions for node.js and browser.",
5-
"version": "1.1.1",
5+
"version": "1.2.0",
66
"dependencies": {
77
"@azure/ms-rest-azure-js": "^2.1.0",
88
"@azure/ms-rest-js": "^2.2.0",

sdk/hybridkubernetes/arm-hybridkubernetes/src/connectedKubernetesClientContext.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
import * as Models from "./models";
1111
import * as msRest from "@azure/ms-rest-js";
12-
import { TokenCredential } from "@azure/core-auth";
1312
import * as msRestAzure from "@azure/ms-rest-azure-js";
13+
import { TokenCredential } from "@azure/core-auth";
1414

1515
const packageName = "@azure/arm-hybridkubernetes";
16-
const packageVersion = "1.1.1";
16+
const packageVersion = "1.2.0";
1717

1818
export class ConnectedKubernetesClientContext extends msRestAzure.AzureServiceClient {
1919
credentials: msRest.ServiceClientCredentials | TokenCredential;
@@ -49,7 +49,7 @@ export class ConnectedKubernetesClientContext extends msRestAzure.AzureServiceCl
4949

5050
super(credentials, options);
5151

52-
this.apiVersion = '2021-03-01';
52+
this.apiVersion = '2021-10-01';
5353
this.acceptLanguage = 'en-US';
5454
this.longRunningOperationRetryTimeout = 30;
5555
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";

sdk/hybridkubernetes/arm-hybridkubernetes/src/models/connectedClusterOperationsMappers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ export {
1313
ConnectedClusterIdentity,
1414
ConnectedClusterList,
1515
ConnectedClusterPatch,
16+
CredentialResult,
17+
CredentialResults,
1618
ErrorAdditionalInfo,
1719
ErrorDetail,
1820
ErrorResponse,
21+
HybridConnectionConfig,
22+
ListClusterUserCredentialProperties,
1923
ProxyResource,
2024
Resource,
2125
SystemData,

sdk/hybridkubernetes/arm-hybridkubernetes/src/models/index.ts

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,64 @@ export interface ConnectedCluster extends TrackedResource {
220220
readonly systemData?: SystemData;
221221
}
222222

223+
/**
224+
* Contains the REP (rendezvous endpoint) and “Sender” access token.
225+
*/
226+
export interface HybridConnectionConfig {
227+
/**
228+
* Timestamp when this token will be expired.
229+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
230+
*/
231+
readonly expirationTime?: number;
232+
/**
233+
* Name of the connection
234+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
235+
*/
236+
readonly hybridConnectionName?: string;
237+
/**
238+
* Name of the relay.
239+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
240+
*/
241+
readonly relay?: string;
242+
/**
243+
* Sender access token
244+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
245+
*/
246+
readonly token?: string;
247+
}
248+
249+
/**
250+
* The credential result response.
251+
*/
252+
export interface CredentialResult {
253+
/**
254+
* The name of the credential.
255+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
256+
*/
257+
readonly name?: string;
258+
/**
259+
* Base64-encoded Kubernetes configuration file.
260+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
261+
*/
262+
readonly value?: Uint8Array;
263+
}
264+
265+
/**
266+
* The list of credential result response.
267+
*/
268+
export interface CredentialResults {
269+
/**
270+
* Contains the REP (rendezvous endpoint) and “Sender” access token.
271+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
272+
*/
273+
readonly hybridConnectionConfig?: HybridConnectionConfig;
274+
/**
275+
* Base64-encoded Kubernetes configuration file.
276+
* **NOTE: This property will not be serialized. It can only be populated by the server.**
277+
*/
278+
readonly kubeconfigs?: CredentialResult[];
279+
}
280+
223281
/**
224282
* Object containing updates for patch operations.
225283
*/
@@ -235,6 +293,20 @@ export interface ConnectedClusterPatch {
235293
properties?: any;
236294
}
237295

296+
/**
297+
* An interface representing ListClusterUserCredentialProperties.
298+
*/
299+
export interface ListClusterUserCredentialProperties {
300+
/**
301+
* The mode of client authentication. Possible values include: 'Token', 'AAD'
302+
*/
303+
authenticationMethod: AuthenticationMethod;
304+
/**
305+
* Boolean value to indicate whether the request is for client side proxy or not
306+
*/
307+
clientProxy: boolean;
308+
}
309+
238310
/**
239311
* The resource model definition for a Azure Resource Manager proxy resource. It will not have tags
240312
* and a location
@@ -386,6 +458,14 @@ export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key';
386458
*/
387459
export type LastModifiedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key';
388460

461+
/**
462+
* Defines values for AuthenticationMethod.
463+
* Possible values include: 'Token', 'AAD'
464+
* @readonly
465+
* @enum {string}
466+
*/
467+
export type AuthenticationMethod = 'Token' | 'AAD';
468+
389469
/**
390470
* Contains response data for the create operation.
391471
*/
@@ -446,6 +526,26 @@ export type ConnectedClusterGetResponse = ConnectedCluster & {
446526
};
447527
};
448528

529+
/**
530+
* Contains response data for the listClusterUserCredential operation.
531+
*/
532+
export type ConnectedClusterListClusterUserCredentialResponse = CredentialResults & {
533+
/**
534+
* The underlying HTTP response.
535+
*/
536+
_response: msRest.HttpResponse & {
537+
/**
538+
* The response body as text (string format)
539+
*/
540+
bodyAsText: string;
541+
542+
/**
543+
* The response body as parsed JSON or XML
544+
*/
545+
parsedBody: CredentialResults;
546+
};
547+
};
548+
449549
/**
450550
* Contains response data for the listByResourceGroup operation.
451551
*/

sdk/hybridkubernetes/arm-hybridkubernetes/src/models/mappers.ts

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,99 @@ export const ConnectedCluster: msRest.CompositeMapper = {
321321
}
322322
};
323323

324+
export const HybridConnectionConfig: msRest.CompositeMapper = {
325+
serializedName: "HybridConnectionConfig",
326+
type: {
327+
name: "Composite",
328+
className: "HybridConnectionConfig",
329+
modelProperties: {
330+
expirationTime: {
331+
readOnly: true,
332+
serializedName: "expirationTime",
333+
type: {
334+
name: "Number"
335+
}
336+
},
337+
hybridConnectionName: {
338+
readOnly: true,
339+
serializedName: "hybridConnectionName",
340+
type: {
341+
name: "String"
342+
}
343+
},
344+
relay: {
345+
readOnly: true,
346+
serializedName: "relay",
347+
type: {
348+
name: "String"
349+
}
350+
},
351+
token: {
352+
readOnly: true,
353+
serializedName: "token",
354+
type: {
355+
name: "String"
356+
}
357+
}
358+
}
359+
}
360+
};
361+
362+
export const CredentialResult: msRest.CompositeMapper = {
363+
serializedName: "CredentialResult",
364+
type: {
365+
name: "Composite",
366+
className: "CredentialResult",
367+
modelProperties: {
368+
name: {
369+
readOnly: true,
370+
serializedName: "name",
371+
type: {
372+
name: "String"
373+
}
374+
},
375+
value: {
376+
readOnly: true,
377+
serializedName: "value",
378+
type: {
379+
name: "ByteArray"
380+
}
381+
}
382+
}
383+
}
384+
};
385+
386+
export const CredentialResults: msRest.CompositeMapper = {
387+
serializedName: "CredentialResults",
388+
type: {
389+
name: "Composite",
390+
className: "CredentialResults",
391+
modelProperties: {
392+
hybridConnectionConfig: {
393+
readOnly: true,
394+
serializedName: "hybridConnectionConfig",
395+
type: {
396+
name: "Composite",
397+
className: "HybridConnectionConfig"
398+
}
399+
},
400+
kubeconfigs: {
401+
readOnly: true,
402+
serializedName: "kubeconfigs",
403+
type: {
404+
name: "Sequence",
405+
element: {
406+
type: {
407+
name: "Composite",
408+
className: "CredentialResult"
409+
}
410+
}
411+
}
412+
}
413+
}
414+
}
415+
};
416+
324417
export const ConnectedClusterPatch: msRest.CompositeMapper = {
325418
serializedName: "ConnectedClusterPatch",
326419
type: {
@@ -348,6 +441,30 @@ export const ConnectedClusterPatch: msRest.CompositeMapper = {
348441
}
349442
};
350443

444+
export const ListClusterUserCredentialProperties: msRest.CompositeMapper = {
445+
serializedName: "ListClusterUserCredentialProperties",
446+
type: {
447+
name: "Composite",
448+
className: "ListClusterUserCredentialProperties",
449+
modelProperties: {
450+
authenticationMethod: {
451+
required: true,
452+
serializedName: "authenticationMethod",
453+
type: {
454+
name: "String"
455+
}
456+
},
457+
clientProxy: {
458+
required: true,
459+
serializedName: "clientProxy",
460+
type: {
461+
name: "Boolean"
462+
}
463+
}
464+
}
465+
}
466+
};
467+
351468
export const ProxyResource: msRest.CompositeMapper = {
352469
serializedName: "ProxyResource",
353470
type: {

sdk/hybridkubernetes/arm-hybridkubernetes/src/models/parameters.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ export const resourceGroupName: msRest.OperationURLParameter = {
6060
serializedName: "resourceGroupName",
6161
constraints: {
6262
MaxLength: 90,
63-
MinLength: 1,
64-
Pattern: /^[-\w\._\(\)]+$/
63+
MinLength: 1
6564
},
6665
type: {
6766
name: "String"

0 commit comments

Comments
 (0)