diff --git a/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md index 3fe2e75ff498..4c2c7781efb6 100644 --- a/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md @@ -1,28 +1,43 @@ # 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-07-06) **Features** + - Added Interface AgentConfiguration + - Added Interface CloudMetadata + - Added Interface ConfigurationExtension - Added Interface OSProfileLinuxConfiguration - Added Interface OSProfileWindowsConfiguration - Added Interface PrivateEndpointConnectionDataModel + - Added Interface ServiceStatus + - Added Interface ServiceStatuses + - Added Type Alias AgentConfigurationMode + - Added Type Alias AssessmentModeTypes + - 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 + - Type Alias Machine has a new parameter resources + - Added Enum KnownAgentConfigurationMode + - Added Enum KnownAssessmentModeTypes + - Added Enum KnownPatchModeTypes + +**Breaking Changes** + + - Interface MachineProperties no longer has parameter extensions + - Interface MachineProperties no longer has parameter osName ## 3.0.0 (2022-01-18) diff --git a/sdk/hybridcompute/arm-hybridcompute/_meta.json b/sdk/hybridcompute/arm-hybridcompute/_meta.json index cfd9a4374eb7..b1b46a84c0c7 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": "357c3028d38f5e4227b0b4a4d0790109c3172983", + "readme": "specification/hybridcompute/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.3 --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-alpha.19.20220425.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.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.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..e21ad4e4c0c0 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,11 @@ "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" + "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,7 +95,7 @@ "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:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -106,13 +108,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..9a3ff13e64fc 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; @@ -109,6 +138,22 @@ export interface Identity { // @public export type InstanceViewTypes = string; +// @public +export enum KnownAgentConfigurationMode { + // (undocumented) + Full = "full", + // (undocumented) + Monitor = "monitor" +} + +// @public +export enum KnownAssessmentModeTypes { + // (undocumented) + AutomaticByPlatform = "AutomaticByPlatform", + // (undocumented) + ImageDefault = "ImageDefault" +} + // @public export enum KnownCreatedByType { // (undocumented) @@ -127,6 +172,18 @@ export enum KnownInstanceViewTypes { InstanceView = "instanceView" } +// @public +export enum KnownPatchModeTypes { + // (undocumented) + AutomaticByOS = "AutomaticByOS", + // (undocumented) + AutomaticByPlatform = "AutomaticByPlatform", + // (undocumented) + ImageDefault = "ImageDefault", + // (undocumented) + Manual = "Manual" +} + // @public export enum KnownPublicNetworkAccessType { Disabled = "Disabled", @@ -164,6 +221,7 @@ export interface LocationData { // @public export type Machine = TrackedResource & { properties?: MachineProperties; + readonly resources?: MachineExtension[]; identity?: Identity; readonly systemData?: SystemData; }; @@ -194,12 +252,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; } @@ -277,10 +340,15 @@ export type MachineExtensionUpdate = ResourceUpdate & { // @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 +369,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,12 +380,10 @@ export interface MachineProperties { readonly dnsFqdn?: string; readonly domainName?: string; readonly errorDetails?: ErrorDetail[]; - extensions?: MachineExtensionInstanceView[]; readonly lastStatusChange?: Date; locationData?: LocationData; readonly machineFqdn?: string; mssqlDiscovered?: string; - readonly osName?: string; osProfile?: OSProfile; readonly osSku?: string; osType?: string; @@ -323,6 +391,7 @@ export interface MachineProperties { parentClusterResourceId?: string; privateLinkScopeResourceId?: string; readonly provisioningState?: string; + serviceStatuses?: ServiceStatuses; readonly status?: StatusTypes; vmId?: string; readonly vmUuid?: string; @@ -384,6 +453,7 @@ export type MachineUpdate = ResourceUpdate & { // @public export interface MachineUpdateProperties { + cloudMetadata?: CloudMetadata; locationData?: LocationData; osProfile?: OSProfile; parentClusterResourceId?: string; @@ -410,6 +480,7 @@ export type OperationsListResponse = OperationListResult; // @public export interface OperationValue { display?: OperationValueDisplay; + readonly isDataAction?: boolean; readonly name?: string; readonly origin?: string; } @@ -431,14 +502,19 @@ 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 PatchModeTypes = string; + // @public export type PrivateEndpointConnection = ProxyResource & { properties?: PrivateEndpointConnectionProperties; @@ -461,6 +537,7 @@ export interface PrivateEndpointConnectionListResult { // @public export interface PrivateEndpointConnectionProperties { + readonly groupIds?: string[]; privateEndpoint?: PrivateEndpointProperty; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty; readonly provisioningState?: string; @@ -690,6 +767,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; diff --git a/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts b/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts index 0b0fbb7ceec0..5a1170ab3ca9 100644 --- a/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts +++ b/sdk/hybridcompute/arm-hybridcompute/src/hybridComputeManagementClient.ts @@ -8,6 +8,11 @@ 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"; @@ -67,7 +72,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 +119,42 @@ 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-05-10-preview"; this.machines = new MachinesImpl(this); this.machineExtensions = new MachineExtensionsImpl(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 item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } /** diff --git a/sdk/hybridcompute/arm-hybridcompute/src/models/index.ts b/sdk/hybridcompute/arm-hybridcompute/src/models/index.ts index 2223e789af12..9e101905400e 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; /** @@ -102,11 +111,6 @@ export interface MachineProperties { readonly machineFqdn?: string; /** Public Key that the client provides to be used during initial resource onboarding */ clientPublicKey?: string; - /** - * The Operating System running on the hybrid machine. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly osName?: string; /** * The version of Operating System running on the hybrid machine. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -119,8 +123,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 +168,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 +267,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 +333,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 +368,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 +392,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 +402,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. */ @@ -368,6 +461,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 +553,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 +701,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. */ @@ -640,12 +745,10 @@ export type HybridComputePrivateLinkScope = PrivateLinkScopesResource & { 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 type MachineExtension = 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. @@ -653,10 +756,17 @@ export type Machine = TrackedResource & { readonly systemData?: SystemData; }; -/** Describes a Machine Extension. */ -export type MachineExtension = TrackedResource & { - /** Describes Machine Extension Properties. */ - properties?: MachineExtensionProperties; +/** Describes a hybrid machine. */ +export type Machine = 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. @@ -700,6 +810,58 @@ export enum KnownInstanceViewTypes { */ export type InstanceViewTypes = string; +/** Known values of {@link AgentConfigurationMode} that the service accepts. */ +export enum KnownAgentConfigurationMode { + Full = "full", + 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", + 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", + AutomaticByPlatform = "AutomaticByPlatform", + AutomaticByOS = "AutomaticByOS", + 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", diff --git a/sdk/hybridcompute/arm-hybridcompute/src/models/mappers.ts b/sdk/hybridcompute/arm-hybridcompute/src/models/mappers.ts index 18083d2ef24f..88de7e3ded3d 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: { @@ -190,13 +211,6 @@ export const MachineProperties: coreClient.CompositeMapper = { name: "String" } }, - osName: { - serializedName: "osName", - readOnly: true, - type: { - name: "String" - } - }, osVersion: { serializedName: "osVersion", readOnly: true, @@ -217,18 +231,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 +326,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 +536,12 @@ export const OSProfileWindowsConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } } } } @@ -379,6 +557,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 +714,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 +789,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 +848,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 +877,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: { @@ -834,6 +1030,13 @@ export const OperationValue: coreClient.CompositeMapper = { name: "Composite", className: "OperationValueDisplay" } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } } } } @@ -1009,6 +1212,18 @@ export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + groupIds: { + serializedName: "groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -1315,6 +1530,13 @@ export const MachineUpdateProperties: coreClient.CompositeMapper = { className: "OSProfile" } }, + cloudMetadata: { + serializedName: "cloudMetadata", + type: { + name: "Composite", + className: "CloudMetadata" + } + }, parentClusterResourceId: { serializedName: "parentClusterResourceId", type: { @@ -1430,24 +1652,17 @@ export const HybridComputePrivateLinkScope: coreClient.CompositeMapper = { } }; -export const Machine: coreClient.CompositeMapper = { +export const MachineExtension: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Machine", + className: "MachineExtension", modelProperties: { ...TrackedResource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Composite", - className: "MachineProperties" - } - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "Identity" + className: "MachineExtensionProperties" } }, systemData: { @@ -1461,17 +1676,37 @@ export const Machine: coreClient.CompositeMapper = { } }; -export const MachineExtension: coreClient.CompositeMapper = { +export const Machine: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MachineExtension", + className: "Machine", modelProperties: { ...TrackedResource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Composite", - className: "MachineExtensionProperties" + className: "MachineProperties" + } + }, + resources: { + serializedName: "resources", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MachineExtension" + } + } + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "Identity" } }, systemData: { diff --git a/sdk/hybridcompute/arm-hybridcompute/src/models/parameters.ts b/sdk/hybridcompute/arm-hybridcompute/src/models/parameters.ts index 3e589fbc8dbd..379b52b482e7 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-05-10-preview", isConstant: true, serializedName: "api-version", type: { 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/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"