Skip to content

Commit

Permalink
Migrate ConnectedMachine from generation to main (Azure#26288)
Browse files Browse the repository at this point in the history
* Move ConnectedMachine to main

* Update ChangeLog.md

---------

Co-authored-by: azure-powershell-bot <[email protected]>
Co-authored-by: NanxiangLiu <[email protected]>
  • Loading branch information
3 people authored Oct 12, 2024
1 parent 0b89984 commit 66deca2
Show file tree
Hide file tree
Showing 303 changed files with 10,397 additions and 54,077 deletions.
1,058 changes: 55 additions & 1,003 deletions src/ConnectedMachine/ConnectedMachine.Autorest/Az.ConnectedMachine.format.ps1xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.ConnectedMachine.private.dll'
FormatsToProcess = './Az.ConnectedMachine.format.ps1xml'
FunctionsToExport = 'Connect-AzConnectedMachine', 'Get-AzConnectedExtensionMetadata', 'Get-AzConnectedLicense', 'Get-AzConnectedMachine', 'Get-AzConnectedMachineExtension', 'Get-AzConnectedMachineRunCommand', 'Get-AzConnectedNetworkSecurityPerimeterConfiguration', 'Get-AzConnectedPrivateLinkScope', 'Install-AzConnectedMachinePatch', 'Invoke-AzConnectedAssessMachinePatch', 'New-AzConnectedLicense', 'New-AzConnectedLicenseDetail', 'New-AzConnectedMachineExtension', 'New-AzConnectedMachineRunCommand', 'New-AzConnectedPrivateLinkScope', 'Remove-AzConnectedLicense', 'Remove-AzConnectedMachine', 'Remove-AzConnectedMachineExtension', 'Remove-AzConnectedMachineRunCommand', 'Remove-AzConnectedPrivateLinkScope', 'Set-AzConnectedLicense', 'Set-AzConnectedMachineExtension', 'Set-AzConnectedPrivateLinkScope', 'Update-AzConnectedExtension', 'Update-AzConnectedMachine', 'Update-AzConnectedMachineExtension', 'Update-AzConnectedMachineRunCommand', 'Update-AzConnectedPrivateLinkScopeTag'
FunctionsToExport = 'Connect-AzConnectedMachine', 'Get-AzConnectedExtensionMetadata', 'Get-AzConnectedLicense', 'Get-AzConnectedMachine', 'Get-AzConnectedMachineExtension', 'Get-AzConnectedNetworkSecurityPerimeterConfiguration', 'Get-AzConnectedPrivateLinkScope', 'Install-AzConnectedMachinePatch', 'Invoke-AzConnectedAssessMachinePatch', 'Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration', 'New-AzConnectedLicense', 'New-AzConnectedLicenseDetail', 'New-AzConnectedMachineExtension', 'New-AzConnectedPrivateLinkScope', 'Remove-AzConnectedLicense', 'Remove-AzConnectedMachine', 'Remove-AzConnectedMachineExtension', 'Remove-AzConnectedPrivateLinkScope', 'Set-AzConnectedLicense', 'Set-AzConnectedMachineExtension', 'Set-AzConnectedPrivateLinkScope', 'Update-AzConnectedExtension', 'Update-AzConnectedMachine', 'Update-AzConnectedMachineExtension', 'Update-AzConnectedPrivateLinkScopeTag'
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ConnectedMachine'
Expand Down
100 changes: 47 additions & 53 deletions src/ConnectedMachine/ConnectedMachine.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ In this directory, run AutoRest:
> see https://aka.ms/autorest
``` yaml
commit: 2e5be0e72597c6fc8d438f20e38087d900c16427
commit: f41d0c9332078cb2ef07b749081d94915255ada5
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/HybridCompute.json
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/privateLinkScopes.json
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/HybridCompute.json
- $(repo)/specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/privateLinkScopes.json

module-version: 0.1.0
title: ConnectedMachine
Expand Down Expand Up @@ -175,42 +175,42 @@ directive:
}
}
# 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": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
}
}
}
# add 200 response to run-command delete - comment out for stable release
# - 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": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse"
# }
# }
# }

# GetViaIdentity isn't useful until Azure PowerShell supports piping of different subjects
- where:
Expand Down Expand Up @@ -333,14 +333,14 @@ directive:
variant: Upgrade
remove: true

# we will release gateway and setting commands in a seperate module
- where:
subject: Gateway
remove: true
# Remove when this API version is added
- where:
subject: Setting
remove: true
# we will release gateway and setting commands in a seperate module - comment out for stable release
# - where:
# subject: Gateway
# remove: true
# Remove when this API version is added - comment out for stable release
# - where:
# subject: Setting
# remove: true

# We don't want user to send PATCH to the ESU license API
- where:
Expand All @@ -361,12 +361,6 @@ directive:
subject: NetworkConfiguration
remove: true

# Remove when this API is fixed
- where:
subject: ReconcileNetworkSecurityPerimeterConfiguration$
verb: Invoke
remove: true

# becasue autorest.powershell is unable to transform IdentityType as the best practice design if it uses managed identity
# we hide the original cmdlet and custom it under /custom folder
- where:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "licenses",
"apiVersion": "2024-05-20-preview",
"apiVersion": "2024-07-10",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedmachine"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "locations/publishers/extensionTypes/versions",
"apiVersion": "2024-05-20-preview",
"apiVersion": "2024-07-10",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedmachine"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "machines/extensions",
"apiVersion": "2024-05-20-preview",
"apiVersion": "2024-07-10",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedmachine"
},
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "machines",
"apiVersion": "2024-05-20-preview",
"apiVersion": "2024-07-10",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedmachine"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateLinkScopes/networkSecurityPerimeterConfigurations",
"apiVersion": "2024-05-20-preview",
"apiVersion": "2024-07-10",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedmachine"
},
Expand Down Expand Up @@ -47,6 +47,49 @@
]
}
]
},
{
"name": "Invoke-AzConnectedReconcileNetworkSecurityPerimeterConfiguration",
"description": "Forces the network security perimeter configuration to refresh for a private link scope.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedmachine/invoke-azconnectedreconcilenetworksecurityperimeterconfiguration"
},
"parameterSets": [
{
"parameters": [
"-PerimeterName <String>",
"-ResourceGroupName <String>",
"-ScopeName <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Forces the network security perimeter configuration to refresh for a private link scope.",
"parameters": [
{
"name": "-PerimeterName",
"value": "[Path.perimeterName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-ScopeName",
"value": "[Path.scopeName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "privateLinkScopes",
"apiVersion": "2024-05-20-preview",
"apiVersion": "2024-07-10",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.connectedmachine"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ if(-not $NotIsolated -and -not $Debugger) {
$binFolder = Join-Path $PSScriptRoot 'bin'
$objFolder = Join-Path $PSScriptRoot 'obj'

$isAzure = [System.Convert]::ToBoolean('true')

if(-not $Debugger) {
Write-Host -ForegroundColor Green 'Cleaning build folders...'
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
Expand Down Expand Up @@ -151,7 +153,7 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
$addComplexInterfaceInfo = !$isAzure
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}

Expand Down Expand Up @@ -186,5 +188,4 @@ if (-not $DisableAfterBuildTasks){
}
}


Write-Host -ForegroundColor Green '-------------Done-------------'
Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models
{
using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions;
// comment out for stable release

public partial class MachineRunCommand
{
public string MachineName
{
get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?<subscriptionId>[^/]+)/resourceGroups/(?<resourceGroupName>[^/]+)/providers/Microsoft.HybridCompute/machines/(?<machineName>[^/]+)",
global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ?
new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?<subscriptionId>[^/]+)/resourceGroups/(?<resourceGroupName>[^/]+)/providers/Microsoft.HybridCompute/machines/(?<machineName>[^/]+)",
global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["machineName"].Value : null);
}
}
// namespace Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Models
// {
// using static Microsoft.Azure.PowerShell.Cmdlets.ConnectedMachine.Runtime.Extensions;

}
// public partial class MachineRunCommand
// {
// public string MachineName
// {
// get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?<subscriptionId>[^/]+)/resourceGroups/(?<resourceGroupName>[^/]+)/providers/Microsoft.HybridCompute/machines/(?<machineName>[^/]+)",
// global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ?
// new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?<subscriptionId>[^/]+)/resourceGroups/(?<resourceGroupName>[^/]+)/providers/Microsoft.HybridCompute/machines/(?<machineName>[^/]+)",
// global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["machineName"].Value : null);
// }
// }

// }
Loading

0 comments on commit 66deca2

Please sign in to comment.