diff --git a/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md b/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md index 3fe2e75ff498..152983c34891 100644 --- a/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md +++ b/sdk/hybridcompute/arm-hybridcompute/CHANGELOG.md @@ -1,28 +1,36 @@ # Release History - -## 3.1.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 3.1.0-beta.1 (2022-04-26) + +## 3.1.0-beta.2 (2022-05-24) **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 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 KnownAssessmentModeTypes + - Added Enum KnownPatchModeTypes ## 3.0.0 (2022-01-18) diff --git a/sdk/hybridcompute/arm-hybridcompute/_meta.json b/sdk/hybridcompute/arm-hybridcompute/_meta.json index cfd9a4374eb7..4b430eadca6a 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": "9a055e810d5133590e8985bc5550d14c95d51697", + "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=/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.3.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..754997369dae 100644 --- a/sdk/hybridcompute/arm-hybridcompute/package.json +++ b/sdk/hybridcompute/arm-hybridcompute/package.json @@ -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..f0808324ab5f 100644 --- a/sdk/hybridcompute/arm-hybridcompute/review/arm-hybridcompute.api.md +++ b/sdk/hybridcompute/arm-hybridcompute/review/arm-hybridcompute.api.md @@ -10,6 +10,31 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; +// @public +export interface AgentConfiguration { + readonly extensionsAllowList?: ConfigurationExtension[]; + readonly extensionsBlockList?: ConfigurationExtension[]; + readonly extensionsEnabled?: string; + readonly guestConfigurationEnabled?: string; + readonly incomingConnectionsPorts?: string[]; + readonly proxyBypass?: string[]; + readonly proxyUrl?: 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 +134,14 @@ export interface Identity { // @public export type InstanceViewTypes = string; +// @public +export enum KnownAssessmentModeTypes { + // (undocumented) + AutomaticByPlatform = "AutomaticByPlatform", + // (undocumented) + ImageDefault = "ImageDefault" +} + // @public export enum KnownCreatedByType { // (undocumented) @@ -127,6 +160,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 +209,7 @@ export interface LocationData { // @public export type Machine = TrackedResource & { properties?: MachineProperties; + readonly resources?: MachineExtension[]; identity?: Identity; readonly systemData?: SystemData; }; @@ -194,6 +240,7 @@ export interface MachineExtensionInstanceViewStatus { // @public export interface MachineExtensionProperties { autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; forceUpdateTag?: string; instanceView?: MachineExtensionInstanceView; protectedSettings?: Record; @@ -277,6 +324,7 @@ export type MachineExtensionUpdate = ResourceUpdate & { // @public export interface MachineExtensionUpdateProperties { autoUpgradeMinorVersion?: boolean; + enableAutomaticUpgrade?: boolean; forceUpdateTag?: string; protectedSettings?: Record; publisher?: string; @@ -301,8 +349,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; }; @@ -323,6 +373,7 @@ export interface MachineProperties { parentClusterResourceId?: string; privateLinkScopeResourceId?: string; readonly provisioningState?: string; + serviceStatuses?: ServiceStatuses; readonly status?: StatusTypes; vmId?: string; readonly vmUuid?: string; @@ -384,6 +435,7 @@ export type MachineUpdate = ResourceUpdate & { // @public export interface MachineUpdateProperties { + cloudMetadata?: CloudMetadata; locationData?: LocationData; osProfile?: OSProfile; parentClusterResourceId?: string; @@ -410,6 +462,7 @@ export type OperationsListResponse = OperationListResult; // @public export interface OperationValue { display?: OperationValueDisplay; + readonly isDataAction?: boolean; readonly name?: string; readonly origin?: string; } @@ -431,14 +484,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 +519,7 @@ export interface PrivateEndpointConnectionListResult { // @public export interface PrivateEndpointConnectionProperties { + readonly groupIds?: string[]; privateEndpoint?: PrivateEndpointProperty; privateLinkServiceConnectionState?: PrivateLinkServiceConnectionStateProperty; readonly provisioningState?: string; @@ -690,6 +749,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..9103020240d4 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"; @@ -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..dfdf42a2dfde 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; /** @@ -166,6 +175,84 @@ 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; +} + +/** 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 +269,17 @@ 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 Machine Extension Instance View. */ @@ -217,20 +308,31 @@ 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; +/** 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?: Record; + /** The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ + protectedSettings?: Record; /** - * The tenant ID of resource. + * 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 tenantId?: string; - /** The identity type. */ - type?: "SystemAssigned"; + readonly provisioningState?: string; + /** The machine extension instance view. */ + instanceView?: MachineExtensionInstanceView; } /** Metadata pertaining to creation and last modification of the resource. */ @@ -268,6 +370,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 +394,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,6 +404,8 @@ 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. */ @@ -368,6 +463,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 +555,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 +703,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 +747,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 +758,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 +812,42 @@ export enum KnownInstanceViewTypes { */ export type InstanceViewTypes = 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..ac71fa451780 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: { @@ -324,6 +345,169 @@ 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" + } + } + } + } +}; + +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 +548,12 @@ export const OSProfileWindowsConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } } } } @@ -379,6 +569,12 @@ export const OSProfileLinuxConfiguration: coreClient.CompositeMapper = { type: { name: "String" } + }, + patchMode: { + serializedName: "patchSettings.patchMode", + type: { + name: "String" + } } } } @@ -457,32 +653,74 @@ export const MachineExtensionInstanceViewStatus: coreClient.CompositeMapper = { } }; -export const Identity: coreClient.CompositeMapper = { +export const MachineExtensionProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "Identity", + className: "MachineExtensionProperties", modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, + forceUpdateTag: { + serializedName: "forceUpdateTag", type: { name: "String" } }, - tenantId: { - serializedName: "tenantId", - readOnly: true, + publisher: { + serializedName: "publisher", type: { name: "String" } }, type: { - defaultValue: "SystemAssigned", - isConstant: true, 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" + } } } } @@ -563,6 +801,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 +860,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 +889,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 +1042,13 @@ export const OperationValue: coreClient.CompositeMapper = { name: "Composite", className: "OperationValueDisplay" } + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean" + } } } } @@ -1009,6 +1224,18 @@ export const PrivateEndpointConnectionProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + groupIds: { + serializedName: "groupIds", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -1315,6 +1542,13 @@ export const MachineUpdateProperties: coreClient.CompositeMapper = { className: "OSProfile" } }, + cloudMetadata: { + serializedName: "cloudMetadata", + type: { + name: "Composite", + className: "CloudMetadata" + } + }, parentClusterResourceId: { serializedName: "parentClusterResourceId", type: { @@ -1430,24 +1664,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 +1688,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/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"