From 047bbc82672a034aece71a4a7a190785ceb932b4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 22 Jan 2021 02:32:29 +0000 Subject: [PATCH] CodeGen from PR 12129 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.ContainerInstance to add version stable/2020-11-01 (#12129) --- .../arm-containerinstance/LICENSE.txt | 2 +- .../arm-containerinstance/README.md | 9 ++- .../arm-containerinstance/rollup.config.js | 4 +- .../src/containerInstanceManagementClient.ts | 5 +- ...ontainerInstanceManagementClientContext.ts | 7 +- .../src/models/containerGroupsMappers.ts | 5 +- .../src/models/containersMappers.ts | 5 +- .../arm-containerinstance/src/models/index.ts | 66 ++++++++++++++++- .../src/models/locationMappers.ts | 4 +- .../src/models/mappers.ts | 66 ++++++++++++++++- .../src/models/operationsMappers.ts | 4 +- .../src/models/parameters.ts | 17 ++++- .../src/operations/containerGroups.ts | 11 ++- .../src/operations/containers.ts | 72 +++++++++++++++++-- .../src/operations/index.ts | 5 +- .../src/operations/location.ts | 11 ++- .../src/operations/operations.ts | 8 ++- 17 files changed, 255 insertions(+), 46 deletions(-) diff --git a/sdk/containerinstance/arm-containerinstance/LICENSE.txt b/sdk/containerinstance/arm-containerinstance/LICENSE.txt index ea8fb1516028..2d3163745319 100644 --- a/sdk/containerinstance/arm-containerinstance/LICENSE.txt +++ b/sdk/containerinstance/arm-containerinstance/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2020 Microsoft +Copyright (c) 2021 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 diff --git a/sdk/containerinstance/arm-containerinstance/README.md b/sdk/containerinstance/arm-containerinstance/README.md index 22a236e2f712..8dc6a1b42563 100644 --- a/sdk/containerinstance/arm-containerinstance/README.md +++ b/sdk/containerinstance/arm-containerinstance/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-containerinstance ### How to use -#### nodejs - Authentication, client creation and list containerGroups as an example written in TypeScript. +#### nodejs - client creation and list containerGroups as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { ContainerInstanceManagementClient, ContainerInstanceManagementModels, ContainerInstanceManagementMappers } from "@azure/arm-containerinstance"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { ContainerInstanceManagementClient } = require("@azure/arm-containerinstance"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/containerinstance/arm-containerinstance/rollup.config.js b/sdk/containerinstance/arm-containerinstance/rollup.config.js index 2437ccec684c..f7b5ecb278d2 100644 --- a/sdk/containerinstance/arm-containerinstance/rollup.config.js +++ b/sdk/containerinstance/arm-containerinstance/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts b/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts index 671cd2fd1e83..0fb60a54b53e 100644 --- a/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts +++ b/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClientContext.ts b/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClientContext.ts index ac325059e274..ab8356433148 100644 --- a/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClientContext.ts +++ b/sdk/containerinstance/arm-containerinstance/src/containerInstanceManagementClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -45,7 +44,7 @@ export class ContainerInstanceManagementClientContext extends msRestAzure.AzureS super(credentials, options); - this.apiVersion = '2019-12-01'; + this.apiVersion = '2020-11-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/containerinstance/arm-containerinstance/src/models/containerGroupsMappers.ts b/sdk/containerinstance/arm-containerinstance/src/models/containerGroupsMappers.ts index dbf4971118f9..53d30b744762 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/containerGroupsMappers.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/containerGroupsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -30,6 +30,7 @@ export { Event, GitRepoVolume, GpuResource, + HttpHeaders, ImageRegistryCredential, InitContainerDefinition, InitContainerPropertiesDefinitionInstanceView, diff --git a/sdk/containerinstance/arm-containerinstance/src/models/containersMappers.ts b/sdk/containerinstance/arm-containerinstance/src/models/containersMappers.ts index b48e748c39c4..1a8ffd6e640d 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/containersMappers.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/containersMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -8,6 +8,7 @@ export { CloudError, + ContainerAttachResponse, ContainerExecRequest, ContainerExecRequestTerminalSize, ContainerExecResponse, diff --git a/sdk/containerinstance/arm-containerinstance/src/models/index.ts b/sdk/containerinstance/arm-containerinstance/src/models/index.ts index 3f3c3e97c6f9..7ce98ccfbdc8 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/index.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -228,6 +228,20 @@ export interface ContainerExec { command?: string[]; } +/** + * The HTTP headers. + */ +export interface HttpHeaders { + /** + * The header name. + */ + name?: string; + /** + * The header value. + */ + value?: string; +} + /** * The container Http Get settings, for liveness or readiness probe */ @@ -244,6 +258,10 @@ export interface ContainerHttpGet { * The scheme. Possible values include: 'http', 'https' */ scheme?: Scheme; + /** + * The HTTP headers. + */ + httpHeaders?: HttpHeaders; } /** @@ -538,6 +556,10 @@ export interface LogAnalytics { * Metadata for log analytics. */ metadata?: { [propertyName: string]: string }; + /** + * The workspace resource id for log analytics + */ + workspaceResourceId?: { [propertyName: string]: string }; } /** @@ -893,6 +915,21 @@ export interface ContainerExecResponse { password?: string; } +/** + * The information for the output stream from container attach. + */ +export interface ContainerAttachResponse { + /** + * The uri for the output stream from the attach. + */ + webSocketUri?: string; + /** + * The password to the output stream from the attach. Send as an Authorization header value when + * connecting to the websocketUri. + */ + password?: string; +} + /** * The cached image and OS type. */ @@ -973,6 +1010,11 @@ export interface ContainersListLogsOptionalParams extends msRest.RequestOptionsB * available logs are shown up to 4mb. */ tail?: number; + /** + * If true, adds a timestamp at the beginning of every line of log output. If not provided, + * defaults to false. + */ + timestamps?: boolean; } /** @@ -1506,3 +1548,23 @@ export type ContainersExecuteCommandResponse = ContainerExecResponse & { parsedBody: ContainerExecResponse; }; }; + +/** + * Contains response data for the attach operation. + */ +export type ContainersAttachResponse = ContainerAttachResponse & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ContainerAttachResponse; + }; +}; diff --git a/sdk/containerinstance/arm-containerinstance/src/models/locationMappers.ts b/sdk/containerinstance/arm-containerinstance/src/models/locationMappers.ts index ebace621abb6..02d047eee097 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/locationMappers.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/locationMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts b/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts index a7a07f7762e2..31a466e5b32d 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -367,6 +367,28 @@ export const ContainerExec: msRest.CompositeMapper = { } }; +export const HttpHeaders: msRest.CompositeMapper = { + serializedName: "HttpHeaders", + type: { + name: "Composite", + className: "HttpHeaders", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + export const ContainerHttpGet: msRest.CompositeMapper = { serializedName: "ContainerHttpGet", type: { @@ -391,6 +413,13 @@ export const ContainerHttpGet: msRest.CompositeMapper = { type: { name: "String" } + }, + httpHeaders: { + serializedName: "httpHeaders", + type: { + name: "Composite", + className: "HttpHeaders" + } } } } @@ -904,6 +933,17 @@ export const LogAnalytics: msRest.CompositeMapper = { } } } + }, + workspaceResourceId: { + serializedName: "workspaceResourceId", + type: { + name: "Dictionary", + value: { + type: { + name: "String" + } + } + } } } } @@ -1521,6 +1561,28 @@ export const ContainerExecResponse: msRest.CompositeMapper = { } }; +export const ContainerAttachResponse: msRest.CompositeMapper = { + serializedName: "ContainerAttachResponse", + type: { + name: "Composite", + className: "ContainerAttachResponse", + modelProperties: { + webSocketUri: { + serializedName: "webSocketUri", + type: { + name: "String" + } + }, + password: { + serializedName: "password", + type: { + name: "String" + } + } + } + } +}; + export const CachedImages: msRest.CompositeMapper = { serializedName: "cachedImages", type: { diff --git a/sdk/containerinstance/arm-containerinstance/src/models/operationsMappers.ts b/sdk/containerinstance/arm-containerinstance/src/models/operationsMappers.ts index 689688180be7..938d3e665a23 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/operationsMappers.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts b/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts index bef66ab107c8..ed5f3d1ee2de 100644 --- a/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts +++ b/sdk/containerinstance/arm-containerinstance/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -103,3 +102,15 @@ export const tail: msRest.OperationQueryParameter = { } } }; +export const timestamps: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "timestamps" + ], + mapper: { + serializedName: "timestamps", + type: { + name: "Boolean" + } + } +}; diff --git a/sdk/containerinstance/arm-containerinstance/src/operations/containerGroups.ts b/sdk/containerinstance/arm-containerinstance/src/operations/containerGroups.ts index e22c00af0a01..7a03a85e7d17 100644 --- a/sdk/containerinstance/arm-containerinstance/src/operations/containerGroups.ts +++ b/sdk/containerinstance/arm-containerinstance/src/operations/containerGroups.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -635,6 +634,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -656,6 +658,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/containerinstance/arm-containerinstance/src/operations/containers.ts b/sdk/containerinstance/arm-containerinstance/src/operations/containers.ts index 4faed844d4e5..7688c71254e1 100644 --- a/sdk/containerinstance/arm-containerinstance/src/operations/containers.ts +++ b/sdk/containerinstance/arm-containerinstance/src/operations/containers.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -105,6 +104,44 @@ export class Containers { executeCommandOperationSpec, callback) as Promise; } + + /** + * Attach to the output stream of a specific container instance in a specified resource group and + * container group. + * @summary Attach to the output of a specific container instance. + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param [options] The optional parameters + * @returns Promise + */ + attach(resourceGroupName: string, containerGroupName: string, containerName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param callback The callback + */ + attach(resourceGroupName: string, containerGroupName: string, containerName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param options The optional parameters + * @param callback The callback + */ + attach(resourceGroupName: string, containerGroupName: string, containerName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + attach(resourceGroupName: string, containerGroupName: string, containerName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + containerGroupName, + containerName, + options + }, + attachOperationSpec, + callback) as Promise; + } } // Operation Specifications @@ -120,7 +157,8 @@ const listLogsOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.apiVersion, - Parameters.tail + Parameters.tail, + Parameters.timestamps ], headerParameters: [ Parameters.acceptLanguage @@ -168,3 +206,29 @@ const executeCommandOperationSpec: msRest.OperationSpec = { }, serializer }; + +const attachOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/attach", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.containerGroupName, + Parameters.containerName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.ContainerAttachResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/sdk/containerinstance/arm-containerinstance/src/operations/index.ts b/sdk/containerinstance/arm-containerinstance/src/operations/index.ts index 8f71b1e895e3..22d882286661 100644 --- a/sdk/containerinstance/arm-containerinstance/src/operations/index.ts +++ b/sdk/containerinstance/arm-containerinstance/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/containerinstance/arm-containerinstance/src/operations/location.ts b/sdk/containerinstance/arm-containerinstance/src/operations/location.ts index c8d112e20db1..954cef4405d9 100644 --- a/sdk/containerinstance/arm-containerinstance/src/operations/location.ts +++ b/sdk/containerinstance/arm-containerinstance/src/operations/location.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -252,6 +251,9 @@ const listCachedImagesNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -273,6 +275,9 @@ const listCapabilitiesNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/containerinstance/arm-containerinstance/src/operations/operations.ts b/sdk/containerinstance/arm-containerinstance/src/operations/operations.ts index f8b4b30a9e7c..7940cd22d60d 100644 --- a/sdk/containerinstance/arm-containerinstance/src/operations/operations.ts +++ b/sdk/containerinstance/arm-containerinstance/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ],