From 2ed98f63ec578936c9401e109d3b8531d13d9672 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 13 Sep 2022 20:59:51 +0000 Subject: [PATCH] CodeGen from PR 20502 in Azure/azure-rest-api-specs Merge a17dc946a4f8208c89fed16e121777e7a34c09fd into bfbabddc83d6e5d800be4f08760249e7be9b22cc --- common/config/rush/pnpm-lock.yaml | 11 +- .../arm-hybridcompute/CHANGELOG.md | 55 +- .../arm-hybridcompute/_meta.json | 12 +- .../arm-hybridcompute/package.json | 27 +- .../review/arm-hybridcompute.api.md | 187 ++++-- .../src/hybridComputeManagementClient.ts | 42 +- .../arm-hybridcompute/src/models/index.ts | 389 +++++++++--- .../arm-hybridcompute/src/models/mappers.ts | 563 ++++++++++++++---- .../src/models/parameters.ts | 46 +- .../src/operations/extensionMetadata.ts | 191 ++++++ .../arm-hybridcompute/src/operations/index.ts | 1 + .../src/operations/machines.ts | 2 +- .../operationsInterfaces/extensionMetadata.ts | 48 ++ .../src/operationsInterfaces/index.ts | 1 + .../src/operationsInterfaces/machines.ts | 2 +- .../arm-hybridcompute/test/sampleTest.ts | 39 +- .../arm-hybridcompute/tsconfig.json | 10 +- 17 files changed, 1324 insertions(+), 302 deletions(-) create mode 100644 sdk/hybridcompute/arm-hybridcompute/src/operations/extensionMetadata.ts create mode 100644 sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/extensionMetadata.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index eab8c36cbaad..b411f3c708d2 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3949,7 +3949,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.9.0-dev.20220912 + typescript: 4.9.0-dev.20220913 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8881,8 +8881,8 @@ packages: hasBin: true dev: false - /typescript/4.9.0-dev.20220912: - resolution: {integrity: sha512-B1WnNBtZgqkG48/Z1v4VQWxZSjJl+iJdgafU/8mLFOZyinS5Jejz04TucADMOTufHaIc4USMcYALrAg03Twg1A==} + /typescript/4.9.0-dev.20220913: + resolution: {integrity: sha512-v/DpPFVU1aThfbgdqGaTFD97b+aDqHqkAnQGb6VVsuxiO4/84aIzXp/Xsc7P6sz7+7RiWJqogy2O3Qg3DtD/Fg==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -12237,7 +12237,7 @@ packages: dev: false file:projects/arm-hybridcompute.tgz: - resolution: {integrity: sha512-D2rtn/wbxeY6eP10mUt42c7m58m7tFOGLH06X18f0CFMKmlcrht8TUUYWNEwxSRer/xRArvDHd7uS7HB7l+38Q==, tarball: file:projects/arm-hybridcompute.tgz} + resolution: {integrity: sha512-xBz9s6xGCAdHymYpJjMumY21nPLFXW0wVO9WdUUjCakatwhKjk4/T8tMW4bh5SsGI0FZVtTFx6fazV0A5qvaVg==, tarball: file:projects/arm-hybridcompute.tgz} name: '@rush-temp/arm-hybridcompute' version: 0.0.0 dependencies: @@ -12248,6 +12248,8 @@ packages: '@rollup/plugin-json': 4.1.0_rollup@2.79.0 '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.0 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.0 + '@types/chai': 4.3.3 + chai: 4.3.6 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 @@ -12259,7 +12261,6 @@ packages: uglify-js: 3.17.0 transitivePeerDependencies: - '@types/node' - - encoding - supports-color dev: false diff --git a/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md index 3fe2e75ff498..0d505aa5e4a6 100644 --- a/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md @@ -1,28 +1,59 @@ # Release History - -## 3.1.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 3.1.0-beta.1 (2022-04-26) + +## 4.0.0-beta.1 (2022-09-13) **Features** + - Added operation group ExtensionMetadata + - Added Interface AgentConfiguration + - Added Interface CloudMetadata + - Added Interface ConfigurationExtension + - Added Interface ExtensionMetadataGetOptionalParams + - Added Interface ExtensionMetadataListOptionalParams + - Added Interface ExtensionValue + - Added Interface ExtensionValueListResult + - Added Interface ExtensionValueProperties + - Added Interface HybridComputePrivateLinkScope + - Added Interface Machine + - Added Interface MachineExtension + - Added Interface MachineExtensionUpdate + - Added Interface MachineUpdate - Added Interface OSProfileLinuxConfiguration - Added Interface OSProfileWindowsConfiguration + - Added Interface PrivateEndpointConnection - Added Interface PrivateEndpointConnectionDataModel + - Added Interface PrivateLinkResource + - Added Interface ProxyResource + - Added Interface ServiceStatus + - Added Interface ServiceStatuses + - Added Interface TrackedResource + - Added Type Alias AgentConfigurationMode + - Added Type Alias AssessmentModeTypes + - Added Type Alias ExtensionMetadataGetResponse + - Added Type Alias ExtensionMetadataListResponse + - Added Type Alias PatchModeTypes - Interface HybridComputePrivateLinkScopeProperties has a new optional parameter privateEndpointConnections + - Interface MachineExtensionProperties has a new optional parameter enableAutomaticUpgrade + - Interface MachineExtensionUpdateProperties has a new optional parameter enableAutomaticUpgrade + - Interface MachineProperties has a new optional parameter agentConfiguration + - Interface MachineProperties has a new optional parameter cloudMetadata - Interface MachineProperties has a new optional parameter mssqlDiscovered - Interface MachineProperties has a new optional parameter osType + - Interface MachineProperties has a new optional parameter serviceStatuses + - Interface MachineUpdateProperties has a new optional parameter cloudMetadata - Interface MachineUpdateProperties has a new optional parameter osProfile + - Interface OperationValue has a new optional parameter isDataAction - Interface OSProfile has a new optional parameter linuxConfiguration - Interface OSProfile has a new optional parameter windowsConfiguration + - Interface PrivateEndpointConnectionProperties has a new optional parameter groupIds + - Class HybridComputeManagementClient has a new parameter extensionMetadata + - Added Enum KnownAgentConfigurationMode + - Added Enum KnownAssessmentModeTypes + - Added Enum KnownPatchModeTypes + +**Breaking Changes** + + - Interface MachineProperties no longer has parameter extensions ## 3.0.0 (2022-01-18) diff --git a/sdk/hybridcompute/arm-hybridcompute/_meta.json b/sdk/hybridcompute/arm-hybridcompute/_meta.json index cfd9a4374eb7..c703df28e70c 100644 --- a/sdk/hybridcompute/arm-hybridcompute/_meta.json +++ b/sdk/hybridcompute/arm-hybridcompute/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1f1d5b0b9ce6cc94605b2fd619dce374fb6e033a", - "readme": "specification\\hybridcompute\\resource-manager\\readme.md", - "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=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\hybridcompute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "80111eb4bbf02a77a5b1c95615530f71ff9f2a08", + "readme": "specification/hybridcompute/resource-manager/readme.md", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/hybridcompute/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", + "use": "@autorest/typescript@6.0.0-rc.1" +} \ No newline at end of file diff --git a/sdk/hybridcompute/arm-hybridcompute/package.json b/sdk/hybridcompute/arm-hybridcompute/package.json index fa61b44427af..66f697d3d4a2 100644 --- a/sdk/hybridcompute/arm-hybridcompute/package.json +++ b/sdk/hybridcompute/arm-hybridcompute/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for HybridComputeManagementClient.", - "version": "3.1.0-beta.2", + "version": "4.0.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,13 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hybridcompute/arm-hybridcompute", "repository": { @@ -93,9 +97,8 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -106,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-hybridcompute?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/hybridcompute/arm-hybridcompute/review/arm-hybridcompute.api.md b/sdk/hybridcompute/arm-hybridcompute/review/arm-hybridcompute.api.md index 30309689f8a0..1f5fae4e466e 100644 --- a/sdk/hybridcompute/arm-hybridcompute/review/arm-hybridcompute.api.md +++ b/sdk/hybridcompute/arm-hybridcompute/review/arm-hybridcompute.api.md @@ -10,6 +10,35 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; +// @public +export interface AgentConfiguration { + readonly configMode?: AgentConfigurationMode; + readonly extensionsAllowList?: ConfigurationExtension[]; + readonly extensionsBlockList?: ConfigurationExtension[]; + readonly extensionsEnabled?: string; + readonly guestConfigurationEnabled?: string; + readonly incomingConnectionsPorts?: string[]; + readonly proxyBypass?: string[]; + readonly proxyUrl?: string; +} + +// @public +export type AgentConfigurationMode = string; + +// @public +export type AssessmentModeTypes = string; + +// @public +export interface CloudMetadata { + readonly provider?: string; +} + +// @public +export interface ConfigurationExtension { + readonly publisher?: string; + readonly type?: string; +} + // @public (undocumented) export interface ConnectionDetail { readonly groupId?: string; @@ -42,11 +71,50 @@ export interface ErrorResponse { error?: ErrorDetail; } +// @public +export interface ExtensionMetadata { + get(locations: string, publishers: string, extensionTypes: string, versions: string, options?: ExtensionMetadataGetOptionalParams): Promise; + list(locations: string, publishers: string, extensionTypes: string, options?: ExtensionMetadataListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ExtensionMetadataGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionMetadataGetResponse = ExtensionValue; + +// @public +export interface ExtensionMetadataListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ExtensionMetadataListResponse = ExtensionValueListResult; + // @public export interface ExtensionTargetProperties { targetVersion?: string; } +// @public +export interface ExtensionValue extends ProxyResource { + properties?: ExtensionValueProperties; +} + +// @public +export interface ExtensionValueListResult { + readonly value?: ExtensionValue[]; +} + +// @public +export interface ExtensionValueProperties { + readonly extensionTypes?: string; + readonly locations?: string; + readonly publishers?: string; + readonly requestId?: string; + readonly versions?: string; +} + // @public (undocumented) export class HybridComputeManagementClient extends coreClient.ServiceClient { // (undocumented) @@ -57,6 +125,8 @@ export class HybridComputeManagementClient extends coreClient.ServiceClient { beginUpgradeExtensions(resourceGroupName: string, machineName: string, extensionUpgradeParameters: MachineExtensionUpgrade, options?: UpgradeExtensionsOptionalParams): Promise, void>>; beginUpgradeExtensionsAndWait(resourceGroupName: string, machineName: string, extensionUpgradeParameters: MachineExtensionUpgrade, options?: UpgradeExtensionsOptionalParams): Promise; // (undocumented) + extensionMetadata: ExtensionMetadata; + // (undocumented) machineExtensions: MachineExtensions; // (undocumented) machines: Machines; @@ -80,10 +150,10 @@ export interface HybridComputeManagementClientOptionalParams extends coreClient. } // @public -export type HybridComputePrivateLinkScope = PrivateLinkScopesResource & { +export interface HybridComputePrivateLinkScope extends PrivateLinkScopesResource { properties?: HybridComputePrivateLinkScopeProperties; readonly systemData?: SystemData; -}; +} // @public export interface HybridComputePrivateLinkScopeListResult { @@ -109,24 +179,39 @@ export interface Identity { // @public export type InstanceViewTypes = string; +// @public +export enum KnownAgentConfigurationMode { + Full = "full", + Monitor = "monitor" +} + +// @public +export enum KnownAssessmentModeTypes { + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault" +} + // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownInstanceViewTypes { - // (undocumented) InstanceView = "instanceView" } +// @public +export enum KnownPatchModeTypes { + AutomaticByOS = "AutomaticByOS", + AutomaticByPlatform = "AutomaticByPlatform", + ImageDefault = "ImageDefault", + Manual = "Manual" +} + // @public export enum KnownPublicNetworkAccessType { Disabled = "Disabled", @@ -135,21 +220,15 @@ export enum KnownPublicNetworkAccessType { // @public export enum KnownStatusLevelTypes { - // (undocumented) Error = "Error", - // (undocumented) Info = "Info", - // (undocumented) Warning = "Warning" } // @public export enum KnownStatusTypes { - // (undocumented) Connected = "Connected", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Error = "Error" } @@ -162,17 +241,18 @@ export interface LocationData { } // @public -export type Machine = TrackedResource & { - properties?: MachineProperties; +export interface Machine extends TrackedResource { identity?: Identity; + properties?: MachineProperties; + readonly resources?: MachineExtension[]; readonly systemData?: SystemData; -}; +} // @public -export type MachineExtension = TrackedResource & { +export interface MachineExtension extends TrackedResource { properties?: MachineExtensionProperties; readonly systemData?: SystemData; -}; +} // @public export interface MachineExtensionInstanceView { @@ -194,12 +274,17 @@ export interface MachineExtensionInstanceViewStatus { // @public export interface MachineExtensionProperties { autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; forceUpdateTag?: string; instanceView?: MachineExtensionInstanceView; - protectedSettings?: Record; + protectedSettings?: { + [propertyName: string]: any; + }; readonly provisioningState?: string; publisher?: string; - settings?: Record; + settings?: { + [propertyName: string]: any; + }; type?: string; typeHandlerVersion?: string; } @@ -270,17 +355,22 @@ export interface MachineExtensionsUpdateOptionalParams extends coreClient.Operat export type MachineExtensionsUpdateResponse = MachineExtension; // @public -export type MachineExtensionUpdate = ResourceUpdate & { +export interface MachineExtensionUpdate extends ResourceUpdate { properties?: MachineExtensionUpdateProperties; -}; +} // @public export interface MachineExtensionUpdateProperties { autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; forceUpdateTag?: string; - protectedSettings?: Record; + protectedSettings?: { + [propertyName: string]: any; + }; publisher?: string; - settings?: Record; + settings?: { + [propertyName: string]: any; + }; type?: string; typeHandlerVersion?: string; } @@ -301,8 +391,10 @@ export interface MachineListResult { // @public export interface MachineProperties { readonly adFqdn?: string; + readonly agentConfiguration?: AgentConfiguration; readonly agentVersion?: string; clientPublicKey?: string; + cloudMetadata?: CloudMetadata; readonly detectedProperties?: { [propertyName: string]: string; }; @@ -310,7 +402,6 @@ export interface MachineProperties { readonly dnsFqdn?: string; readonly domainName?: string; readonly errorDetails?: ErrorDetail[]; - extensions?: MachineExtensionInstanceView[]; readonly lastStatusChange?: Date; locationData?: LocationData; readonly machineFqdn?: string; @@ -323,6 +414,7 @@ export interface MachineProperties { parentClusterResourceId?: string; privateLinkScopeResourceId?: string; readonly provisioningState?: string; + serviceStatuses?: ServiceStatuses; readonly status?: StatusTypes; vmId?: string; readonly vmUuid?: string; @@ -377,13 +469,14 @@ export interface MachinesListBySubscriptionOptionalParams extends coreClient.Ope export type MachinesListBySubscriptionResponse = MachineListResult; // @public -export type MachineUpdate = ResourceUpdate & { +export interface MachineUpdate extends ResourceUpdate { identity?: Identity; properties?: MachineUpdateProperties; -}; +} // @public export interface MachineUpdateProperties { + cloudMetadata?: CloudMetadata; locationData?: LocationData; osProfile?: OSProfile; parentClusterResourceId?: string; @@ -410,6 +503,7 @@ export type OperationsListResponse = OperationListResult; // @public export interface OperationValue { display?: OperationValueDisplay; + readonly isDataAction?: boolean; readonly name?: string; readonly origin?: string; } @@ -431,19 +525,24 @@ export interface OSProfile { // @public export interface OSProfileLinuxConfiguration { - assessmentMode?: string; + assessmentMode?: AssessmentModeTypes; + patchMode?: PatchModeTypes; } // @public export interface OSProfileWindowsConfiguration { - assessmentMode?: string; + assessmentMode?: AssessmentModeTypes; + patchMode?: PatchModeTypes; } // @public -export type PrivateEndpointConnection = ProxyResource & { +export type PatchModeTypes = string; + +// @public +export interface PrivateEndpointConnection extends ProxyResource { properties?: PrivateEndpointConnectionProperties; readonly systemData?: SystemData; -}; +} // @public export interface PrivateEndpointConnectionDataModel { @@ -461,6 +560,7 @@ export interface PrivateEndpointConnectionListResult { // @public export interface PrivateEndpointConnectionProperties { + readonly groupIds?: string[]; privateEndpoint?: PrivateEndpointProperty; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty; readonly provisioningState?: string; @@ -518,10 +618,10 @@ export interface PrivateEndpointProperty { } // @public -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { properties?: PrivateLinkResourceProperties; readonly systemData?: SystemData; -}; +} // @public export interface PrivateLinkResourceListResult { @@ -671,7 +771,8 @@ export interface PrivateLinkServiceConnectionStateProperty { } // @public -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource { +} // @public export type PublicNetworkAccessType = string; @@ -690,6 +791,18 @@ export interface ResourceUpdate { }; } +// @public +export interface ServiceStatus { + startupType?: string; + status?: string; +} + +// @public +export interface ServiceStatuses { + extensionService?: ServiceStatus; + guestConfigurationService?: ServiceStatus; +} + // @public export type StatusLevelTypes = string; @@ -714,12 +827,12 @@ export interface TagsResource { } // @public -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { + location: string; tags?: { [propertyName: string]: string; }; - location: string; -}; +} // @public export interface UpgradeExtensionsOptionalParams extends coreClient.OperationOptions { diff --git a/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts b/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts index 0b0fbb7ceec0..0bdc3c069c9f 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts @@ -8,12 +8,18 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "./lroImpl"; import { MachinesImpl, MachineExtensionsImpl, + ExtensionMetadataImpl, OperationsImpl, PrivateLinkScopesImpl, PrivateLinkResourcesImpl, @@ -22,6 +28,7 @@ import { import { Machines, MachineExtensions, + ExtensionMetadata, Operations, PrivateLinkScopes, PrivateLinkResources, @@ -67,7 +74,7 @@ export class HybridComputeManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-hybridcompute/3.1.0-beta.2`; + const packageDetails = `azsdk-js-arm-hybridcompute/4.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -114,13 +121,43 @@ export class HybridComputeManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-06-10-preview"; + this.apiVersion = options.apiVersion || "2022-08-11-preview"; this.machines = new MachinesImpl(this); this.machineExtensions = new MachineExtensionsImpl(this); + this.extensionMetadata = new ExtensionMetadataImpl(this); this.operations = new OperationsImpl(this); this.privateLinkScopes = new PrivateLinkScopesImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } /** @@ -212,6 +249,7 @@ export class HybridComputeManagementClient extends coreClient.ServiceClient { machines: Machines; machineExtensions: MachineExtensions; + extensionMetadata: ExtensionMetadata; operations: Operations; privateLinkScopes: PrivateLinkScopes; privateLinkResources: PrivateLinkResources; diff --git a/sdk/hybridcompute/arm-hybridcompute/src/models/index.ts b/sdk/hybridcompute/arm-hybridcompute/src/models/index.ts index 2223e789af12..08fd1a7eef04 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/models/index.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/models/index.ts @@ -61,6 +61,15 @@ export interface ErrorAdditionalInfo { export interface MachineProperties { /** Metadata pertaining to the geographic location of the resource. */ locationData?: LocationData; + /** + * Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly agentConfiguration?: AgentConfiguration; + /** Statuses of dependent services that are reported back to ARM. */ + serviceStatuses?: ServiceStatuses; + /** The metadata of the cloud environment (Azure/GCP/AWS/OCI...). */ + cloudMetadata?: CloudMetadata; /** Specifies the operating system settings for the hybrid machine. */ osProfile?: OSProfile; /** @@ -119,8 +128,6 @@ export interface MachineProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly vmUuid?: string; - /** Machine Extensions information */ - extensions?: MachineExtensionInstanceView[]; /** * Specifies the Operating System product SKU. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -166,6 +173,89 @@ export interface LocationData { countryOrRegion?: string; } +/** Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. */ +export interface AgentConfiguration { + /** + * Specifies the URL of the proxy to be used. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly proxyUrl?: string; + /** + * Specifies the list of ports that the agent will be able to listen on. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly incomingConnectionsPorts?: string[]; + /** + * Array of extensions that are allowed to be installed or updated. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionsAllowList?: ConfigurationExtension[]; + /** + * Array of extensions that are blocked (cannot be installed or updated) + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionsBlockList?: ConfigurationExtension[]; + /** + * List of service names which should not use the specified proxy server. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly proxyBypass?: string[]; + /** + * Specifies whether the extension service is enabled or disabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionsEnabled?: string; + /** + * Specified whether the guest configuration service is enabled or disabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly guestConfigurationEnabled?: string; + /** + * Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists and guest configuration, maintained by Microsoft. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly configMode?: AgentConfigurationMode; +} + +/** Describes properties that can identify extensions. */ +export interface ConfigurationExtension { + /** + * Publisher of the extension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publisher?: string; + /** + * Type of the extension. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; +} + +/** Reports the state and behavior of dependent services. */ +export interface ServiceStatuses { + /** The state of the extension service on the Arc-enabled machine. */ + extensionService?: ServiceStatus; + /** The state of the guest configuration service on the Arc-enabled machine. */ + guestConfigurationService?: ServiceStatus; +} + +/** Describes the status and behavior of a service. */ +export interface ServiceStatus { + /** The current status of the service. */ + status?: string; + /** The behavior of the service when the Arc-enabled machine starts up. */ + startupType?: string; +} + +/** The metadata of the cloud environment (Azure/GCP/AWS/OCI...). */ +export interface CloudMetadata { + /** + * Specifies the cloud provider (Azure/AWS/GCP...). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; +} + /** Specifies the operating system settings for the hybrid machine. */ export interface OSProfile { /** @@ -182,13 +272,44 @@ export interface OSProfile { /** Specifies the windows configuration for update management. */ export interface OSProfileWindowsConfiguration { /** Specifies the assessment mode. */ - assessmentMode?: string; + assessmentMode?: AssessmentModeTypes; + /** Specifies the patch mode. */ + patchMode?: PatchModeTypes; } /** Specifies the linux configuration for update management. */ export interface OSProfileLinuxConfiguration { /** Specifies the assessment mode. */ - assessmentMode?: string; + assessmentMode?: AssessmentModeTypes; + /** Specifies the patch mode. */ + patchMode?: PatchModeTypes; +} + +/** Describes the properties of a Machine Extension. */ +export interface MachineExtensionProperties { + /** How the extension handler should be forced to update even if the extension configuration has not changed. */ + forceUpdateTag?: string; + /** The name of the extension handler publisher. */ + publisher?: string; + /** Specifies the type of the extension; an example is "CustomScriptExtension". */ + type?: string; + /** Specifies the version of the script handler. */ + typeHandlerVersion?: string; + /** Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. */ + enableAutomaticUpgrade?: boolean; + /** Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. */ + autoUpgradeMinorVersion?: boolean; + /** Json formatted public settings for the extension. */ + settings?: { [propertyName: string]: any }; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: { [propertyName: string]: any }; + /** + * The provisioning state, which only appears in the response. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** The machine extension instance view. */ + instanceView?: MachineExtensionInstanceView; } /** Describes the Machine Extension Instance View. */ @@ -217,22 +338,6 @@ export interface MachineExtensionInstanceViewStatus { time?: Date; } -/** Identity for the resource. */ -export interface Identity { - /** - * The principal ID of resource identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** The identity type. */ - type?: "SystemAssigned"; -} - /** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { /** The identity that created the resource. */ @@ -268,6 +373,22 @@ export interface Resource { readonly type?: string; } +/** Identity for the resource. */ +export interface Identity { + /** + * The principal ID of resource identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** The identity type. */ + type?: "SystemAssigned"; +} + /** The List hybrid machine operation response. */ export interface MachineListResult { /** The list of hybrid machines. */ @@ -276,31 +397,6 @@ export interface MachineListResult { nextLink?: string; } -/** Describes the properties of a Machine Extension. */ -export interface MachineExtensionProperties { - /** How the extension handler should be forced to update even if the extension configuration has not changed. */ - forceUpdateTag?: string; - /** The name of the extension handler publisher. */ - publisher?: string; - /** Specifies the type of the extension; an example is "CustomScriptExtension". */ - type?: string; - /** Specifies the version of the script handler. */ - typeHandlerVersion?: string; - /** Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. */ - autoUpgradeMinorVersion?: boolean; - /** Json formatted public settings for the extension. */ - settings?: Record; - /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: Record; - /** - * The provisioning state, which only appears in the response. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** The machine extension instance view. */ - instanceView?: MachineExtensionInstanceView; -} - /** Describes the properties of a Machine Extension. */ export interface MachineExtensionUpdateProperties { /** How the extension handler should be forced to update even if the extension configuration has not changed. */ @@ -311,12 +407,14 @@ export interface MachineExtensionUpdateProperties { type?: string; /** Specifies the version of the script handler. */ typeHandlerVersion?: string; + /** Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. */ + enableAutomaticUpgrade?: boolean; /** Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. */ autoUpgradeMinorVersion?: boolean; /** Json formatted public settings for the extension. */ - settings?: Record; + settings?: { [propertyName: string]: any }; /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ - protectedSettings?: Record; + protectedSettings?: { [propertyName: string]: any }; } /** The Update Resource model definition. */ @@ -345,6 +443,44 @@ export interface ExtensionTargetProperties { targetVersion?: string; } +/** Describes Extension Metadata properties */ +export interface ExtensionValueProperties { + /** + * The id of the Extension being received. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly requestId?: string; + /** + * The version of the Extension being received. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly versions?: string; + /** + * The location of the Extension being received. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly locations?: string; + /** + * The type of the Extension being received. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly extensionTypes?: string; + /** + * The publisher of the Extension being received. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publishers?: string; +} + +/** The List Extension Metadata response. */ +export interface ExtensionValueListResult { + /** + * The list of extension metadata + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ExtensionValue[]; +} + /** The List Compute Operation operation response. */ export interface OperationListResult { /** @@ -368,6 +504,11 @@ export interface OperationValue { readonly name?: string; /** Display properties */ display?: OperationValueDisplay; + /** + * This property indicates if the operation is an action or a data action + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; } /** Describes the properties of a Hybrid Compute Operation Value Display. */ @@ -455,6 +596,11 @@ export interface PrivateEndpointConnectionProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: string; + /** + * List of group IDs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly groupIds?: string[]; } /** Private endpoint which the connection belongs to. */ @@ -598,6 +744,8 @@ export interface MachineUpdateProperties { locationData?: LocationData; /** Specifies the operating system settings for the hybrid machine. */ osProfile?: OSProfile; + /** The metadata of the cloud environment (Azure/GCP/AWS/OCI...). */ + cloudMetadata?: CloudMetadata; /** The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. */ parentClusterResourceId?: string; /** The resource id of the private link scope this machine is assigned to, if any. */ @@ -605,32 +753,33 @@ export interface MachineUpdateProperties { } /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export type TrackedResource = Resource & { +export interface TrackedResource extends Resource { /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The geo-location where the resource lives */ location: string; -}; +} /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export type ProxyResource = Resource & {}; +export interface ProxyResource extends Resource {} /** Describes a Machine Extension Update. */ -export type MachineExtensionUpdate = ResourceUpdate & { +export interface MachineExtensionUpdate extends ResourceUpdate { /** Describes Machine Extension Update Properties. */ properties?: MachineExtensionUpdateProperties; -}; +} /** Describes a hybrid machine Update. */ -export type MachineUpdate = ResourceUpdate & { +export interface MachineUpdate extends ResourceUpdate { /** Identity for the resource. */ identity?: Identity; /** Hybrid Compute Machine properties */ properties?: MachineUpdateProperties; -}; +} /** An Azure Arc PrivateLinkScope definition. */ -export type HybridComputePrivateLinkScope = PrivateLinkScopesResource & { +export interface HybridComputePrivateLinkScope + extends PrivateLinkScopesResource { /** Properties that define a Azure Arc PrivateLinkScope resource. */ properties?: HybridComputePrivateLinkScopeProperties; /** @@ -638,34 +787,45 @@ export type HybridComputePrivateLinkScope = PrivateLinkScopesResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; -}; +} -/** Describes a hybrid machine. */ -export type Machine = TrackedResource & { - /** Hybrid Compute Machine properties */ - properties?: MachineProperties; - /** Identity for the resource. */ - identity?: Identity; +/** Describes a Machine Extension. */ +export interface MachineExtension extends TrackedResource { + /** Describes Machine Extension Properties. */ + properties?: MachineExtensionProperties; /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; -}; +} -/** Describes a Machine Extension. */ -export type MachineExtension = TrackedResource & { - /** Describes Machine Extension Properties. */ - properties?: MachineExtensionProperties; +/** Describes a hybrid machine. */ +export interface Machine extends TrackedResource { + /** Hybrid Compute Machine properties */ + properties?: MachineProperties; + /** + * The list of extensions affiliated to the machine + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resources?: MachineExtension[]; + /** Identity for the resource. */ + identity?: Identity; /** * The system meta data relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; -}; +} + +/** Describes a Extension Metadata */ +export interface ExtensionValue extends ProxyResource { + /** The single extension based on search criteria */ + properties?: ExtensionValueProperties; +} /** A private link resource */ -export type PrivateLinkResource = ProxyResource & { +export interface PrivateLinkResource extends ProxyResource { /** Resource properties. */ properties?: PrivateLinkResourceProperties; /** @@ -673,10 +833,10 @@ export type PrivateLinkResource = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; -}; +} /** A private endpoint connection */ -export type PrivateEndpointConnection = ProxyResource & { +export interface PrivateEndpointConnection extends ProxyResource { /** Resource properties. */ properties?: PrivateEndpointConnectionProperties; /** @@ -684,10 +844,11 @@ export type PrivateEndpointConnection = ProxyResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; -}; +} /** Known values of {@link InstanceViewTypes} that the service accepts. */ export enum KnownInstanceViewTypes { + /** InstanceView */ InstanceView = "instanceView" } @@ -700,10 +861,73 @@ export enum KnownInstanceViewTypes { */ export type InstanceViewTypes = string; +/** Known values of {@link AgentConfigurationMode} that the service accepts. */ +export enum KnownAgentConfigurationMode { + /** Full */ + Full = "full", + /** Monitor */ + Monitor = "monitor" +} + +/** + * Defines values for AgentConfigurationMode. \ + * {@link KnownAgentConfigurationMode} can be used interchangeably with AgentConfigurationMode, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **full** \ + * **monitor** + */ +export type AgentConfigurationMode = string; + +/** Known values of {@link AssessmentModeTypes} that the service accepts. */ +export enum KnownAssessmentModeTypes { + /** ImageDefault */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform */ + AutomaticByPlatform = "AutomaticByPlatform" +} + +/** + * Defines values for AssessmentModeTypes. \ + * {@link KnownAssessmentModeTypes} can be used interchangeably with AssessmentModeTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ImageDefault** \ + * **AutomaticByPlatform** + */ +export type AssessmentModeTypes = string; + +/** Known values of {@link PatchModeTypes} that the service accepts. */ +export enum KnownPatchModeTypes { + /** ImageDefault */ + ImageDefault = "ImageDefault", + /** AutomaticByPlatform */ + AutomaticByPlatform = "AutomaticByPlatform", + /** AutomaticByOS */ + AutomaticByOS = "AutomaticByOS", + /** Manual */ + Manual = "Manual" +} + +/** + * Defines values for PatchModeTypes. \ + * {@link KnownPatchModeTypes} can be used interchangeably with PatchModeTypes, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ImageDefault** \ + * **AutomaticByPlatform** \ + * **AutomaticByOS** \ + * **Manual** + */ +export type PatchModeTypes = string; + /** Known values of {@link StatusTypes} that the service accepts. */ export enum KnownStatusTypes { + /** Connected */ Connected = "Connected", + /** Disconnected */ Disconnected = "Disconnected", + /** Error */ Error = "Error" } @@ -720,8 +944,11 @@ export type StatusTypes = string; /** Known values of {@link StatusLevelTypes} that the service accepts. */ export enum KnownStatusLevelTypes { + /** Info */ Info = "Info", + /** Warning */ Warning = "Warning", + /** Error */ Error = "Error" } @@ -738,9 +965,13 @@ export type StatusLevelTypes = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -884,6 +1115,20 @@ export interface UpgradeExtensionsOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface ExtensionMetadataGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ExtensionMetadataGetResponse = ExtensionValue; + +/** Optional parameters. */ +export interface ExtensionMetadataListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ExtensionMetadataListResponse = ExtensionValueListResult; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/hybridcompute/arm-hybridcompute/src/models/mappers.ts b/sdk/hybridcompute/arm-hybridcompute/src/models/mappers.ts index 18083d2ef24f..732017a6ddc9 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/models/mappers.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/models/mappers.ts @@ -116,6 +116,27 @@ export const MachineProperties: coreClient.CompositeMapper = { className: "LocationData" } }, + agentConfiguration: { + serializedName: "agentConfiguration", + type: { + name: "Composite", + className: "AgentConfiguration" + } + }, + serviceStatuses: { + serializedName: "serviceStatuses", + type: { + name: "Composite", + className: "ServiceStatuses" + } + }, + cloudMetadata: { + serializedName: "cloudMetadata", + type: { + name: "Composite", + className: "CloudMetadata" + } + }, osProfile: { serializedName: "osProfile", type: { @@ -217,18 +238,6 @@ export const MachineProperties: coreClient.CompositeMapper = { name: "String" } }, - extensions: { - serializedName: "extensions", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "MachineExtensionInstanceView" - } - } - } - }, osSku: { serializedName: "osSku", readOnly: true, @@ -324,6 +333,176 @@ export const LocationData: coreClient.CompositeMapper = { } }; +export const AgentConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentConfiguration", + modelProperties: { + proxyUrl: { + serializedName: "proxyUrl", + readOnly: true, + type: { + name: "String" + } + }, + incomingConnectionsPorts: { + serializedName: "incomingConnectionsPorts", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + extensionsAllowList: { + serializedName: "extensionsAllowList", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConfigurationExtension" + } + } + } + }, + extensionsBlockList: { + serializedName: "extensionsBlockList", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ConfigurationExtension" + } + } + } + }, + proxyBypass: { + serializedName: "proxyBypass", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + extensionsEnabled: { + serializedName: "extensionsEnabled", + readOnly: true, + type: { + name: "String" + } + }, + guestConfigurationEnabled: { + serializedName: "guestConfigurationEnabled", + readOnly: true, + type: { + name: "String" + } + }, + configMode: { + serializedName: "configMode", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ConfigurationExtension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ConfigurationExtension", + modelProperties: { + publisher: { + serializedName: "publisher", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ServiceStatuses: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceStatuses", + modelProperties: { + extensionService: { + serializedName: "extensionService", + type: { + name: "Composite", + className: "ServiceStatus" + } + }, + guestConfigurationService: { + serializedName: "guestConfigurationService", + type: { + name: "Composite", + className: "ServiceStatus" + } + } + } + } +}; + +export const ServiceStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ServiceStatus", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + startupType: { + serializedName: "startupType", + type: { + name: "String" + } + } + } + } +}; + +export const CloudMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CloudMetadata", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const OSProfile: coreClient.CompositeMapper = { type: { name: "Composite", @@ -364,6 +543,12 @@ export const OSProfileWindowsConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } } } } @@ -379,6 +564,85 @@ export const OSProfileLinuxConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } + } + } + } +}; + +export const MachineExtensionProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtensionProperties", + modelProperties: { + forceUpdateTag: { + serializedName: "forceUpdateTag", + type: { + name: "String" + } + }, + publisher: { + serializedName: "publisher", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "String" + } + }, + typeHandlerVersion: { + serializedName: "typeHandlerVersion", + type: { + name: "String" + } + }, + enableAutomaticUpgrade: { + serializedName: "enableAutomaticUpgrade", + type: { + name: "Boolean" + } + }, + autoUpgradeMinorVersion: { + serializedName: "autoUpgradeMinorVersion", + type: { + name: "Boolean" + } + }, + settings: { + serializedName: "settings", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + protectedSettings: { + serializedName: "protectedSettings", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + instanceView: { + serializedName: "instanceView", + type: { + name: "Composite", + className: "MachineExtensionInstanceView" + } } } } @@ -457,37 +721,6 @@ export const MachineExtensionInstanceViewStatus: coreClient.CompositeMapper = { } }; -export const Identity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Identity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "String" - } - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "String" - } - }, - type: { - defaultValue: "SystemAssigned", - isConstant: true, - serializedName: "type", - type: { - name: "String" - } - } - } - } -}; - export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", @@ -563,6 +796,37 @@ export const Resource: coreClient.CompositeMapper = { } }; +export const Identity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Identity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "String" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "String" + } + }, + type: { + defaultValue: "SystemAssigned", + isConstant: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + export const MachineListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -591,10 +855,10 @@ export const MachineListResult: coreClient.CompositeMapper = { } }; -export const MachineExtensionProperties: coreClient.CompositeMapper = { +export const MachineExtensionUpdateProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MachineExtensionProperties", + className: "MachineExtensionUpdateProperties", modelProperties: { forceUpdateTag: { serializedName: "forceUpdateTag", @@ -620,73 +884,12 @@ export const MachineExtensionProperties: coreClient.CompositeMapper = { name: "String" } }, - autoUpgradeMinorVersion: { - serializedName: "autoUpgradeMinorVersion", + enableAutomaticUpgrade: { + serializedName: "enableAutomaticUpgrade", type: { name: "Boolean" } }, - settings: { - serializedName: "settings", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - protectedSettings: { - serializedName: "protectedSettings", - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String" - } - }, - instanceView: { - serializedName: "instanceView", - type: { - name: "Composite", - className: "MachineExtensionInstanceView" - } - } - } - } -}; - -export const MachineExtensionUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "MachineExtensionUpdateProperties", - modelProperties: { - forceUpdateTag: { - serializedName: "forceUpdateTag", - type: { - name: "String" - } - }, - publisher: { - serializedName: "publisher", - type: { - name: "String" - } - }, - type: { - serializedName: "type", - type: { - name: "String" - } - }, - typeHandlerVersion: { - serializedName: "typeHandlerVersion", - type: { - name: "String" - } - }, autoUpgradeMinorVersion: { serializedName: "autoUpgradeMinorVersion", type: { @@ -787,6 +990,72 @@ export const ExtensionTargetProperties: coreClient.CompositeMapper = { } }; +export const ExtensionValueProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtensionValueProperties", + modelProperties: { + requestId: { + serializedName: "requestId", + readOnly: true, + type: { + name: "String" + } + }, + versions: { + serializedName: "versions", + readOnly: true, + type: { + name: "String" + } + }, + locations: { + serializedName: "locations", + readOnly: true, + type: { + name: "String" + } + }, + extensionTypes: { + serializedName: "extensionTypes", + readOnly: true, + type: { + name: "String" + } + }, + publishers: { + serializedName: "publishers", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ExtensionValueListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExtensionValueListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExtensionValue" + } + } + } + } + } + } +}; + export const OperationListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -834,6 +1103,13 @@ export const OperationValue: coreClient.CompositeMapper = { name: "Composite", className: "OperationValueDisplay" } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } } } } @@ -1009,6 +1285,18 @@ export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + groupIds: { + serializedName: "groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -1315,6 +1603,13 @@ export const MachineUpdateProperties: coreClient.CompositeMapper = { className: "OSProfile" } }, + cloudMetadata: { + serializedName: "cloudMetadata", + type: { + name: "Composite", + className: "CloudMetadata" + } + }, parentClusterResourceId: { serializedName: "parentClusterResourceId", type: { @@ -1430,6 +1725,30 @@ export const HybridComputePrivateLinkScope: coreClient.CompositeMapper = { } }; +export const MachineExtension: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MachineExtension", + modelProperties: { + ...TrackedResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "MachineExtensionProperties" + } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + export const Machine: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1443,6 +1762,19 @@ export const Machine: coreClient.CompositeMapper = { className: "MachineProperties" } }, + resources: { + serializedName: "resources", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MachineExtension" + } + } + } + }, identity: { serializedName: "identity", type: { @@ -1461,24 +1793,17 @@ export const Machine: coreClient.CompositeMapper = { } }; -export const MachineExtension: coreClient.CompositeMapper = { +export const ExtensionValue: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MachineExtension", + className: "ExtensionValue", modelProperties: { - ...TrackedResource.type.modelProperties, + ...ProxyResource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Composite", - className: "MachineExtensionProperties" - } - }, - systemData: { - serializedName: "systemData", - type: { - name: "Composite", - className: "SystemData" + className: "ExtensionValueProperties" } } } diff --git a/sdk/hybridcompute/arm-hybridcompute/src/models/parameters.ts b/sdk/hybridcompute/arm-hybridcompute/src/models/parameters.ts index 3e589fbc8dbd..5d837bf9628b 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/models/parameters.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/models/parameters.ts @@ -47,7 +47,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-06-10-preview", + defaultValue: "2022-08-11-preview", isConstant: true, serializedName: "api-version", type: { @@ -166,6 +166,50 @@ export const extensionUpgradeParameters: OperationParameter = { mapper: MachineExtensionUpgradeMapper }; +export const locations: OperationURLParameter = { + parameterPath: "locations", + mapper: { + serializedName: "locations", + required: true, + type: { + name: "String" + } + } +}; + +export const publishers: OperationURLParameter = { + parameterPath: "publishers", + mapper: { + serializedName: "publishers", + required: true, + type: { + name: "String" + } + } +}; + +export const extensionTypes: OperationURLParameter = { + parameterPath: "extensionTypes", + mapper: { + serializedName: "extensionTypes", + required: true, + type: { + name: "String" + } + } +}; + +export const versions: OperationURLParameter = { + parameterPath: "versions", + mapper: { + serializedName: "versions", + required: true, + type: { + name: "String" + } + } +}; + export const scopeName: OperationURLParameter = { parameterPath: "scopeName", mapper: { diff --git a/sdk/hybridcompute/arm-hybridcompute/src/operations/extensionMetadata.ts b/sdk/hybridcompute/arm-hybridcompute/src/operations/extensionMetadata.ts new file mode 100644 index 000000000000..42c54d28cf9e --- /dev/null +++ b/sdk/hybridcompute/arm-hybridcompute/src/operations/extensionMetadata.ts @@ -0,0 +1,191 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ExtensionMetadata } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { HybridComputeManagementClient } from "../hybridComputeManagementClient"; +import { + ExtensionValue, + ExtensionMetadataListOptionalParams, + ExtensionMetadataGetOptionalParams, + ExtensionMetadataGetResponse, + ExtensionMetadataListResponse +} from "../models"; + +/// +/** Class containing ExtensionMetadata operations. */ +export class ExtensionMetadataImpl implements ExtensionMetadata { + private readonly client: HybridComputeManagementClient; + + /** + * Initialize a new instance of the class ExtensionMetadata class. + * @param client Reference to the service client + */ + constructor(client: HybridComputeManagementClient) { + this.client = client; + } + + /** + * Gets all Extension versions based on location, publisher, extensionType + * @param locations The location of the Extension being received. + * @param publishers The publisher of the Extension being received. + * @param extensionTypes The extensionType of the Extension being received. + * @param options The options parameters. + */ + public list( + locations: string, + publishers: string, + extensionTypes: string, + options?: ExtensionMetadataListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll( + locations, + publishers, + extensionTypes, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage( + locations, + publishers, + extensionTypes, + options + ); + } + }; + } + + private async *listPagingPage( + locations: string, + publishers: string, + extensionTypes: string, + options?: ExtensionMetadataListOptionalParams + ): AsyncIterableIterator { + let result = await this._list( + locations, + publishers, + extensionTypes, + options + ); + yield result.value || []; + } + + private async *listPagingAll( + locations: string, + publishers: string, + extensionTypes: string, + options?: ExtensionMetadataListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + locations, + publishers, + extensionTypes, + options + )) { + yield* page; + } + } + + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version + * @param locations The location of the Extension being received. + * @param publishers The publisher of the Extension being received. + * @param extensionTypes The extensionType of the Extension being received. + * @param versions The version of the Extension being received. + * @param options The options parameters. + */ + get( + locations: string, + publishers: string, + extensionTypes: string, + versions: string, + options?: ExtensionMetadataGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locations, publishers, extensionTypes, versions, options }, + getOperationSpec + ); + } + + /** + * Gets all Extension versions based on location, publisher, extensionType + * @param locations The location of the Extension being received. + * @param publishers The publisher of the Extension being received. + * @param extensionTypes The extensionType of the Extension being received. + * @param options The options parameters. + */ + private _list( + locations: string, + publishers: string, + extensionTypes: string, + options?: ExtensionMetadataListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locations, publishers, extensionTypes, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.HybridCompute/locations/{locations}/publishers/{publishers}/extensionTypes/{extensionTypes}/versions/{versions}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionValue + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.locations, + Parameters.publishers, + Parameters.extensionTypes, + Parameters.versions + ], + headerParameters: [Parameters.accept], + serializer +}; +const listOperationSpec: coreClient.OperationSpec = { + path: + "/providers/Microsoft.HybridCompute/locations/{locations}/publishers/{publishers}/extensionTypes/{extensionTypes}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ExtensionValueListResult + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.locations, + Parameters.publishers, + Parameters.extensionTypes + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/hybridcompute/arm-hybridcompute/src/operations/index.ts b/sdk/hybridcompute/arm-hybridcompute/src/operations/index.ts index f8024e8bc5a1..9a778e7d57fb 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/operations/index.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/operations/index.ts @@ -8,6 +8,7 @@ export * from "./machines"; export * from "./machineExtensions"; +export * from "./extensionMetadata"; export * from "./operations"; export * from "./privateLinkScopes"; export * from "./privateLinkResources"; diff --git a/sdk/hybridcompute/arm-hybridcompute/src/operations/machines.ts b/sdk/hybridcompute/arm-hybridcompute/src/operations/machines.ts index 8a3d838d5415..a99a7b491471 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/operations/machines.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/operations/machines.ts @@ -138,7 +138,7 @@ export class MachinesImpl implements Machines { } /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. * @param options The options parameters. diff --git a/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/extensionMetadata.ts b/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/extensionMetadata.ts new file mode 100644 index 000000000000..3ab9df4739c5 --- /dev/null +++ b/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/extensionMetadata.ts @@ -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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ExtensionValue, + ExtensionMetadataListOptionalParams, + ExtensionMetadataGetOptionalParams, + ExtensionMetadataGetResponse +} from "../models"; + +/// +/** Interface representing a ExtensionMetadata. */ +export interface ExtensionMetadata { + /** + * Gets all Extension versions based on location, publisher, extensionType + * @param locations The location of the Extension being received. + * @param publishers The publisher of the Extension being received. + * @param extensionTypes The extensionType of the Extension being received. + * @param options The options parameters. + */ + list( + locations: string, + publishers: string, + extensionTypes: string, + options?: ExtensionMetadataListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets an Extension Metadata based on location, publisher, extensionType and version + * @param locations The location of the Extension being received. + * @param publishers The publisher of the Extension being received. + * @param extensionTypes The extensionType of the Extension being received. + * @param versions The version of the Extension being received. + * @param options The options parameters. + */ + get( + locations: string, + publishers: string, + extensionTypes: string, + versions: string, + options?: ExtensionMetadataGetOptionalParams + ): Promise; +} diff --git a/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/index.ts b/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/index.ts index f8024e8bc5a1..9a778e7d57fb 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/index.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/index.ts @@ -8,6 +8,7 @@ export * from "./machines"; export * from "./machineExtensions"; +export * from "./extensionMetadata"; export * from "./operations"; export * from "./privateLinkScopes"; export * from "./privateLinkResources"; diff --git a/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/machines.ts b/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/machines.ts index 1fb8be19778a..d8a58a3756d7 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/machines.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/operationsInterfaces/machines.ts @@ -38,7 +38,7 @@ export interface Machines { options?: MachinesListBySubscriptionOptionalParams ): PagedAsyncIterableIterator; /** - * The operation to remove a hybrid machine identity in Azure. + * The operation to delete a hybrid machine. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param machineName The name of the hybrid machine. * @param options The options parameters. diff --git a/sdk/hybridcompute/arm-hybridcompute/test/sampleTest.ts b/sdk/hybridcompute/arm-hybridcompute/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/hybridcompute/arm-hybridcompute/test/sampleTest.ts +++ b/sdk/hybridcompute/arm-hybridcompute/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -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: [] +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables }; describe("My test", () => { let recorder: Recorder; - beforeEach(async function() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() { diff --git a/sdk/hybridcompute/arm-hybridcompute/tsconfig.json b/sdk/hybridcompute/arm-hybridcompute/tsconfig.json index a87ba17ac142..3e6ae96443f3 100644 --- a/sdk/hybridcompute/arm-hybridcompute/tsconfig.json +++ b/sdk/hybridcompute/arm-hybridcompute/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-hybridcompute": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"