Skip to content

Migrate ConnectedMachine from generation to main #23681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3,614 changes: 2,661 additions & 953 deletions src/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.format.ps1xml

Large diffs are not rendered by default.

161 changes: 20 additions & 141 deletions src/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.psd1
Original file line number Diff line number Diff line change
@@ -1,144 +1,23 @@
#
# Module manifest for module 'Az.ConnectedMachine'
#
# Generated by: Microsoft Corporation
#
# Generated on: 11/10/2023
#

@{

# Script module or binary module file associated with this manifest.
RootModule = './Az.ConnectedMachine.psm1'

# Version number of this module.
ModuleVersion = '0.5.2'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

# ID used to uniquely identify this module
GUID = '259a0542-8329-4b9e-8f72-dab0efc583e9'

# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Microsoft Azure PowerShell: ConnectedMachine cmdlets'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '5.1'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.13.2'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = './bin/Az.ConnectedMachine.private.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = './Az.ConnectedMachine.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Connect-AzConnectedMachine', 'Get-AzConnectedExtensionMetadata',
'Get-AzConnectedMachine', 'Get-AzConnectedMachineExtension',
'Get-AzConnectedPrivateLinkScope',
'Install-AzConnectedMachinePatch',
'Invoke-AzConnectedAssessMachinePatch',
'New-AzConnectedMachineExtension',
'New-AzConnectedPrivateLinkScope', 'Remove-AzConnectedMachine',
'Remove-AzConnectedMachineExtension',
'Remove-AzConnectedPrivateLinkScope',
'Set-AzConnectedMachineExtension',
'Set-AzConnectedPrivateLinkScope', 'Update-AzConnectedExtension',
'Update-AzConnectedMachine', 'Update-AzConnectedMachineExtension',
'Update-AzConnectedPrivateLinkScopeTag'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = '*'

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

GUID = '259a0542-8329-4b9e-8f72-dab0efc583e9'
RootModule = './Az.ConnectedMachine.psm1'
ModuleVersion = '0.5.0'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: ConnectedMachine cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.ConnectedMachine.private.dll'
FormatsToProcess = './Az.ConnectedMachine.format.ps1xml'
FunctionsToExport = 'Connect-AzConnectedMachine', 'Get-AzConnectedExtensionMetadata', 'Get-AzConnectedMachine', 'Get-AzConnectedMachineExtension', 'Get-AzConnectedMachineRunCommand', 'Get-AzConnectedPrivateLinkScope', 'Install-AzConnectedMachinePatch', 'Invoke-AzConnectedAssessMachinePatch', 'New-AzConnectedMachineExtension', 'New-AzConnectedMachineRunCommand', 'New-AzConnectedPrivateLinkScope', 'Remove-AzConnectedMachine', 'Remove-AzConnectedMachineExtension', 'Remove-AzConnectedMachineRunCommand', 'Remove-AzConnectedPrivateLinkScope', 'Set-AzConnectedMachineExtension', 'Set-AzConnectedPrivateLinkScope', 'Update-AzConnectedExtension', 'Update-AzConnectedMachine', 'Update-AzConnectedMachineExtension', 'Update-AzConnectedMachineRunCommand', 'Update-AzConnectedPrivateLinkScopeTag'
PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','ResourceManager','ARM','PSModule','ConnectedMachine'

# A URL to the license for this module.
LicenseUri = 'https://aka.ms/azps-license'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/Azure/azure-powershell'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* Removed the version check in MachineExtensionProperties'

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ConnectedMachine'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}

138 changes: 113 additions & 25 deletions src/ConnectedMachine/ConnectedMachine.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,75 @@ AutoRest does not generate authentication code for the module. Authentication is
For information on how to develop for `Az.ConnectedMachine`, see [how-to.md](how-to.md).
<!-- endregion -->


<!-- region Generated -->
# Az.ConnectedMachine
This directory contains the PowerShell module for Hybrid Compute.

---
## Run Generation
In this directory, run AutoRest:
> `autorest`

---
### AutoRest Configuration
> see https://aka.ms/autorest

``` yaml
branch: 2ef47d44ce28c909893ead9b6485e8253ee5eed7
commit: 2d044b8a317aff46d45080f5a797ac376955f648
require:
- $(this-folder)/../readme.azure.noprofile.md
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/HybridCompute.json
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/privateLinkScopes.json

- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/HybridCompute.json
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2023-10-03-preview/privateLinkScopes.json
module-version: 0.5.0
title: ConnectedMachine
subject-prefix: 'Connected'

identity-correction-for-post: true
resourcegroup-append: true
nested-object-to-string: true

directive:
- from: swagger-document
- from: swagger-document
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.",
}
]

- from: swagger-document
where: $.definitions.Machine.properties.properties
transform: >-
return {
"x-ms-client-flatten": true,
"$ref": "#/definitions/MachineProperties",
"description": "Hybrid Compute Machine properties"
}

- from: swagger-document
- from: swagger-document
where: $.definitions.MachineExtensionUpdateProperties.properties
transform: >-
return {
Expand Down Expand Up @@ -152,13 +181,49 @@ directive:
"description": "The machine extension instance view."
}
}
# add 200 response to run-command delete
- from: swagger-document
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": "https://github.com/Azure/azure-rest-api-specs/blob/2d044b8a317aff46d45080f5a797ac376955f648/specification/common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
}
}
}

# GetViaIdentity isn't useful until Azure PowerShell supports piping of different subjects
- where:
verb: Get
variant: ^GetViaIdentity\d?$
variant: ^GetViaIdentity.*$
remove: true

# Make parameters friendlier for extensions
- where:
subject: MachineExtension
Expand Down Expand Up @@ -200,7 +265,7 @@ directive:
parameter-name: AgentUpgradeEnableAutomaticUpgrade
set:
parameter-name: AgentUpgradeEnableAutomatic

# Formatting
- where:
model-name: Machine
Expand Down Expand Up @@ -234,7 +299,7 @@ directive:
- Location
- PublicNetworkAccess
- ProvisioningState

# Removing cmlets
- where:
subject: PrivateEndpointConnection
Expand All @@ -247,16 +312,39 @@ directive:
subject: PrivateLinkScopeValidationDetail
remove: true
- where:
verb: Get
subject: NetworkProfile
remove: true
- where:
subject: AgentVersion
remove: true
- where:
subject: HybridIdentityMetadata
remove: true
- where:
subject: MachineRunCommand
verb: Set
remove: true

# add back when swagger change is checked in
- where:
subject: License
remove: true
- where:
subject: LicenseProfile
remove: true
- where:
subject: NetworkConfiguration
remove: true
- where:
subject: NetworkSecurityPerimeterConfiguration$
remove: true

# Removing non-expand commands
- where:
subject: MachinePatch
variant: ^Install$|^InstallViaIdentity$
variant: ^(Install)(?!.*?Expanded|JsonFilePath|JsonString)
remove: true

# Completers
- where:
parameter-name: Location
Expand All @@ -272,8 +360,8 @@ directive:
name: ResourceGroupName Completer
description: Gets the list of ResourceGroupName's available for this subscription.
script: Get-AzResourceGroup | Select-Object -ExpandProperty ResourceGroupName

# These APIs are used by the agent so they do not need to be in the cmdlets.
- remove-operation:
- Machines_CreateOrUpdate
- remove-operation: Machines_CreateOrUpdate
- remove-operation: MachineRunCommands_Update
```
Loading