Skip to content

Commit

Permalink
CodeGen from PR 17814 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
New review request for Microsoft.ContainerService to add version 2022-01-01 (Azure#17814)

* Adds base for updating Microsoft.ContainerService from version stable/2021-10-01 to version 2022-01-01

* Updates readme

* Updates API version in new specs and examples

* Update readme to help generate SDK (Azure#17371)

* update readme to help generate SDK

* update readme

* Support query parameter 'format' in listClusterUserCredential handler (Azure#17209)

* Support query parameter 'format' in listClusterUserCredential handler

* Add kubelogin to custom words

* Fix enum lint

* Fix typo

* Fix typo

* List admin credential should not have format parameter

* Add adminUsers in aadprofile (Azure#17402)

* Revert "Add adminUsers in aadprofile (Azure#17402)" (Azure#17523)

This reverts commit 1d8f262848ad55df67f60321e2ccc1232c7f746b.

* fix conflict (Azure#17623)

Co-authored-by: Tongyao Si <tosi@microsoft.com>
  • Loading branch information
SDKAuto and norshtein committed Feb 14, 2022
1 parent d5e4636 commit 4cff884
Show file tree
Hide file tree
Showing 13 changed files with 157 additions and 48 deletions.
27 changes: 12 additions & 15 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions sdk/containerservice/arm-containerservice/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# Release History

## 15.0.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes


## 15.1.0 (2022-02-14)

**Features**

- Added Type Alias Format
- Interface ManagedClustersListClusterUserCredentialsOptionalParams has a new optional parameter format
- Added Enum KnownFormat


## 15.0.0 (2021-12-09)

The package of @azure/arm-containerservice is using our next generation design principles since version 15.0.0, which contains breaking changes.
Expand Down
2 changes: 1 addition & 1 deletion sdk/containerservice/arm-containerservice/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Microsoft
Copyright (c) 2022 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions sdk/containerservice/arm-containerservice/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commit": "d710fb7f40338ca6ef00e0a9680be0a3d4cf5059",
"commit": "3ac3598d0973e21837f5d9251dce47cd6553a482",
"readme": "specification/containerservice/resource-manager/readme.md",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/containerservice/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20211130.1",
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/containerservice/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/typescript@6.0.0-alpha.16.20211130.1"
"use": "@autorest/typescript@6.0.0-alpha.16.20220105.1"
}
25 changes: 19 additions & 6 deletions sdk/containerservice/arm-containerservice/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-containerservice.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
}
8 changes: 4 additions & 4 deletions sdk/containerservice/arm-containerservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for ContainerServiceClient.",
"version": "15.0.1",
"version": "15.1.0",
"engines": {
"node": ">=12.0.0"
},
Expand All @@ -29,12 +29,12 @@
"types": "./types/arm-containerservice.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.18.11",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"mkdirp": "^1.0.4",
"rollup": "^2.0.0",
"rollup": "^1.16.3",
"rollup-plugin-sourcemaps": "^0.4.2",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
Expand Down Expand Up @@ -99,4 +99,4 @@
},
"sideEffects": false,
"autoPublish": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ export interface ExtendedLocation {
// @public
export type ExtendedLocationTypes = string;

// @public
export type Format = string;

// @public
export type GPUInstanceProfile = string;

Expand Down Expand Up @@ -767,6 +770,12 @@ export enum KnownExtendedLocationTypes {
EdgeZone = "EdgeZone"
}

// @public
export enum KnownFormat {
Azure = "azure",
Exec = "exec"
}

// @public
export enum KnownGPUInstanceProfile {
// (undocumented)
Expand Down Expand Up @@ -1464,6 +1473,7 @@ export type ManagedClustersListClusterMonitoringUserCredentialsResponse = Creden

// @public
export interface ManagedClustersListClusterUserCredentialsOptionalParams extends coreClient.OperationOptions {
format?: Format;
serverFqdn?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-containerservice/15.0.0`;
const packageDetails = `azsdk-js-arm-containerservice/15.1.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand All @@ -86,7 +86,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient {

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-10-01";
this.apiVersion = options.apiVersion || "2022-01-01";
this.operations = new OperationsImpl(this);
this.managedClusters = new ManagedClustersImpl(this);
this.maintenanceConfigurations = new MaintenanceConfigurationsImpl(this);
Expand Down
20 changes: 20 additions & 0 deletions sdk/containerservice/arm-containerservice/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,24 @@ export enum KnownPublicNetworkAccess {
*/
export type PublicNetworkAccess = string;

/** Known values of {@link Format} that the service accepts. */
export enum KnownFormat {
/** Return azure auth-provider kubeconfig. This format is deprecated in 1.22 and will be fully removed in 1.25. */
Azure = "azure",
/** Return exec format kubeconfig. This format requires kubelogin binary in the path. */
Exec = "exec"
}

/**
* Defines values for Format. \
* {@link KnownFormat} can be used interchangeably with Format,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **azure**: Return azure auth-provider kubeconfig. This format is deprecated in 1.22 and will be fully removed in 1.25. \
* **exec**: Return exec format kubeconfig. This format requires kubelogin binary in the path.
*/
export type Format = string;

/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
User = "User",
Expand Down Expand Up @@ -2413,6 +2431,8 @@ export interface ManagedClustersListClusterUserCredentialsOptionalParams
extends coreClient.OperationOptions {
/** server fqdn type for credentials to be returned */
serverFqdn?: string;
/** Only apply to AAD clusters, specifies the format of returned kubeconfig. Format 'azure' will return azure auth-provider kubeconfig; format 'exec' will return exec format kubeconfig, which requires kubelogin binary in the path. */
format?: Format;
}

/** Contains response data for the listClusterUserCredentials operation. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const $host: OperationURLParameter = {
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2021-10-01",
defaultValue: "2022-01-01",
isConstant: true,
serializedName: "api-version",
type: {
Expand Down Expand Up @@ -145,6 +145,16 @@ export const serverFqdn: OperationQueryParameter = {
}
};

export const format: OperationQueryParameter = {
parameterPath: ["options", "format"],
mapper: {
serializedName: "format",
type: {
name: "String"
}
}
};

export const contentType: OperationParameter = {
parameterPath: ["options", "contentType"],
mapper: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,11 @@ const listClusterUserCredentialsOperationSpec: coreClient.OperationSpec = {
bodyMapper: Mappers.CloudError
}
},
queryParameters: [Parameters.apiVersion, Parameters.serverFqdn],
queryParameters: [
Parameters.apiVersion,
Parameters.serverFqdn,
Parameters.format
],
urlParameters: [
Parameters.$host,
Parameters.subscriptionId,
Expand Down
48 changes: 48 additions & 0 deletions sdk/containerservice/arm-containerservice/test/sampleTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import {
env,
record,
RecorderEnvironmentSetup,
Recorder
} from "@azure-tools/test-recorder";
import * as assert from "assert";

const recorderEnvSetup: RecorderEnvironmentSetup = {
replaceableVariables: {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
},
customizationsOnRecordings: [
(recording: any): any =>
recording.replace(
/"access_token":"[^"]*"/g,
`"access_token":"access_token"`
)
],
queryParametersToSkip: []
};

describe("My test", () => {
let recorder: Recorder;

beforeEach(async function() {
recorder = record(this, recorderEnvSetup);
});

afterEach(async function() {
await recorder.stop();
});

it("sample test", async function() {
console.log("Hi, I'm a test!");
});
});
Loading

0 comments on commit 4cff884

Please sign in to comment.