From 89f9e6919680514f9d3c4e2bc863bef242a9debd Mon Sep 17 00:00:00 2001 From: yaotongms <137821665+yaotongms@users.noreply.github.com> Date: Thu, 11 Apr 2024 18:22:04 -0700 Subject: [PATCH] hybridcompute - update readme.md for SDK commands generation (#28579) * update readme * update npm * remove log file * fix logic * fix readme --- .../hybridcompute/resource-manager/readme.md | 153 +++++++++++++++++- 1 file changed, 150 insertions(+), 3 deletions(-) diff --git a/specification/hybridcompute/resource-manager/readme.md b/specification/hybridcompute/resource-manager/readme.md index f2d7f4a16dea..147c235e7316 100644 --- a/specification/hybridcompute/resource-manager/readme.md +++ b/specification/hybridcompute/resource-manager/readme.md @@ -28,10 +28,157 @@ These are the global settings for the HybridCompute API. openapi-type: arm tag: package-preview-2023-10 directive: + # add fix to swagger and remove them from here in the next swagger release + - from: HybridCompute.json + where: $.definitions.MachineInstallPatchesParameters.properties.maximumDuration + transform: $['format'] = 'duration' + + - from: HybridCompute.json + where: $.definitions.MachineUpdateProperties.properties.privateLinkScopeResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.privateLinkScopeResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.AgentUpgrade.properties.correlationId + transform: $['format'] = 'uuid' + + - from: HybridCompute.json + where: $.definitions.AgentUpgrade.properties.lastAttemptTimestamp + transform: $['format'] = 'date-time' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.vmUuid + transform: $['format'] = 'uuid' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.vmId + transform: $['format'] = 'uuid' + + - from: HybridCompute.json + where: $.definitions.MachineUpdateProperties.properties.parentClusterResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.parentClusterResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.MachineAssessPatchesResult.properties.assessmentActivityId + transform: $['format'] = 'uuid' + + # set expand property of list and show to be both strings + - from: HybridCompute.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}"].get.parameters + transform: >- + return [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "machineName", + "in": "path", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9-_\\.]{1,54}$", + "minLength": 1, + "maxLength": 54, + "description": "The name of the hybrid machine." + }, + { + "name": "$expand", + "in": "query", + "required": false, + "type": "string", + "description": "The expand expression to apply on the operation.", + } + ] + + # add 200 response to run-command delete + - from: HybridCompute.json + where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}"].delete.responses + transform: >- + return { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted", + "headers": { + "Location": { + "description": "The URL of the resource used to check the status of the asynchronous operation.", + "type": "string" + }, + "Retry-After": { + "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", + "type": "integer", + "format": "int32" + }, + "Azure-AsyncOperation": { + "description": "The URI to poll for completion status.", + "type": "string" + } + } + }, + "204": { + "description": "No Content" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + } + + # remove cmdlets - where: - - $.definitions.Machine.properties - suppress: - - BodyTopLevelProperties + subject: NetworkProfile + remove: true + - where: + subject: MachineRunCommand + verb: Set + remove: true + + # remove operations + - remove-operation: Machines_CreateOrUpdate + - remove-operation: MachineRunCommands_Update + - remove-operation: AgentVersion_List + - remove-operation: AgentVersion_Get + - remove-operation: HybridIdentityMetadata_Get + - remove-operation: HybridIdentityMetadata_ListByMachines + + # add back when swagger change is checked in + - remove-operation: Licenses_Get + - remove-operation: Licenses_ValidateLicense + - remove-operation: Licenses_ListBySubscription + - remove-operation: Licenses_ListByResourceGroup + - remove-operation: Licenses_Delete + - remove-operation: Licenses_Update + - remove-operation: Licenses_CreateOrUpdate + + - remove-operation: LicenseProfiles_Get + - remove-operation: LicenseProfiles_Delete + - remove-operation: LicenseProfiles_Update + - remove-operation: LicenseProfiles_List + - remove-operation: LicenseProfiles_CreateOrUpdate + + - remove-operation: NetworkConfigurations_Get + - remove-operation: NetworkConfigurations_Update + - remove-operation: NetworkConfigurations_CreateOrUpdate + + - remove-operation: NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope + - remove-operation: NetworkSecurityPerimeterConfigurations_ListByPrivateLinkScope + - remove-operation: NetworkSecurityPerimeterConfigurations_ReconcileForPrivateLinkScope + ```