-
Notifications
You must be signed in to change notification settings - Fork 4k
Create Az.CloudHsm Module for 2025-03-31 #27947
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
vidai-msft
merged 23 commits into
Azure:release-2025-07-01
from
emmeliaAra:cloudHsm-2025-03-31-v
Jun 24, 2025
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
06b58a3
Initial commit Az.CloudHsm 2025-03-31
emmeliaAra 2fde28a
Update module - feedback
emmeliaAra 073193d
Remove tests for the cmdlets that are removed or hidden.
emmeliaAra f65fb95
Resolve conflict
emmeliaAra 55e804d
Remove empty space
emmeliaAra 490eac2
Reset NuGet Config from Main
emmeliaAra 041133f
merge with main
emmeliaAra 12b0246
Merge branch 'cloudHsm-2025-03-31-v' of https://github.com/emmeliaAra…
emmeliaAra 0332a3f
Update input-file to remote swagger file
emmeliaAra 74f6263
Fix error: BlockIdentifiersNotMatched (5064) - The start and end id…
emmeliaAra 86aba7e
Merge branch 'cloudHsm-2025-03-31-v' of https://github.com/emmeliaAra…
emmeliaAra b064514
update restore test
emmeliaAra d64f5c7
Merge branch 'cloudHsm-2025-03-31-v' of https://github.com/emmeliaAra…
emmeliaAra 3bb1042
Fix batch generation build artifact (#27945)
Pan-Qi 25119a9
Update Readme and example files based on feedback
emmeliaAra 00dc503
Merge branch 'cloudHsm-2025-03-31-v' of https://github.com/emmeliaAra…
emmeliaAra e1b3c8c
update test and examples
emmeliaAra 68d24c9
resolve conflicts with main
emmeliaAra 05ef39e
Updated managed identity remove example + docs/help md for other comm…
emmeliaAra 150f494
Merge branch 'cloudHsm-2025-03-31-v' of https://github.com/emmeliaAra…
emmeliaAra 659d76d
Revert "Fix batch generation build artifact (#27945)"
emmeliaAra 5f57780
fix typo - duplicate commands
emmeliaAra e45cb71
update
emmeliaAra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
bin | ||
obj | ||
.vs | ||
generated | ||
internal | ||
exports | ||
tools | ||
test/*-TestResults.xml | ||
license.txt | ||
/*.ps1 | ||
/*.psd1 | ||
/*.ps1xml | ||
/*.psm1 | ||
/*.snk | ||
/*.csproj | ||
/*.nuspec |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0 (the ""License""); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an ""AS IS"" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code | ||
// is regenerated. | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")] | ||
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")] | ||
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")] | ||
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - CloudHsm")] | ||
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0")] | ||
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0")] | ||
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] | ||
[assembly: System.CLSCompliantAttribute(false)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
<!-- region Generated --> | ||
# Az.CloudHsm | ||
This directory contains the PowerShell module for the CloudHsm service. | ||
|
||
--- | ||
## Info | ||
- Modifiable: yes | ||
- Generated: all | ||
- Committed: yes | ||
- Packaged: yes | ||
|
||
--- | ||
## Detail | ||
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. | ||
|
||
## Module Requirements | ||
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater | ||
|
||
## Authentication | ||
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. | ||
|
||
## Development | ||
For information on how to develop for `Az.CloudHsm`, see [how-to.md](how-to.md). | ||
<!-- endregion --> | ||
|
||
### AutoRest Configuration | ||
|
||
> see https://aka.ms/autorest | ||
|
||
```yaml | ||
# pin the swagger version by using the commit id instead of branch name | ||
commit: 55cb134eeb9f92c8df1f6437a9e1130c4c2c4cc5 | ||
require: | ||
# readme.azure.noprofile.md is the common configuration file | ||
- $(this-folder)/../../readme.azure.noprofile.md | ||
#- $(repo)/specification/xxx/resource-manager/readme.md | ||
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally | ||
# - (this-folder)/relative-path-to-your-local-readme.md | ||
|
||
input-file: | ||
- $(this-folder)/../../../../azure-rest-api-specs-myFork/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2025-03-31/cloudHsm.json | ||
emmeliaAra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
try-require: | ||
- $(repo)/specification/xxx/resource-manager/readme.powershell.md | ||
emmeliaAra marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# For new RP, the version is 0.1.0 | ||
module-version: 0.1.0 | ||
# Normally, title is the service name | ||
title: CloudHsm | ||
|
||
# The next three configurations are exclusive to v3, and in v4, they are activated by default. If you are still using v3, please uncomment them. | ||
# identity-correction-for-post: true | ||
# resourcegroup-append: true | ||
# nested-object-to-string: true | ||
|
||
directive: | ||
# Following are common directives which are normally required in all the RPs | ||
# 1. Remove the unexpanded parameter set | ||
# 2. For New-* cmdlets, ViaIdentity is not required | ||
# Following two directives are v4 specific | ||
- where: | ||
variant: ^(Create|Update)(?!.*?(Expanded)) | ||
remove: true | ||
- where: | ||
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$|^UpdateViaIdentityExpanded$|^CreateViaJsonString$|^CreateViaJsonFilePath$ | ||
remove: true | ||
# Follow directive is v3 specific. If you are using v3, uncomment following directive and comments out two directives above | ||
#- where: | ||
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ | ||
# remove: true | ||
|
||
#Remove ViaIdentity, ViaIdentityExpaned, JsonString and JsonFilePath commands | ||
- where: | ||
variant: ^(Backup|BackupViaIdentityExpanded|Restore|RestoreViaIdentityExpanded|GetViaIdentity|DeleteViaIdentity)(?!.*?(Expanded)) | ||
remove: true | ||
|
||
# Remove the set-* cmdlet | ||
- where: | ||
verb: Set | ||
remove: true | ||
|
||
# Remove the Private Endpoint cmdlet that are autogenerated | ||
- where: | ||
subject: PrivateEndpointConnection|PrivateLinkResource | ||
remove: true | ||
|
||
# Remove the Private Endpoint cmdlet that are autogenerated | ||
- where: | ||
verb: Test | ||
remove: true | ||
|
||
# Remove SkuCapacity, EnableSystemAssignedIdentity, PublicNetworkAccess and Token parameters from all commansd | ||
- where: | ||
parameter-name: SkuCapacity|EnableSystemAssignedIdentity|PublicNetworkAccess|Token | ||
hide: true | ||
|
||
# Rename CloudHsmClusterName parameter to Name. | ||
- where: | ||
parameter-name: CloudHsmClusterName | ||
set: | ||
parameter-name: Name | ||
|
||
# Both commands have property EnableSystemAssignedIdentity as mandatory because in Swaggger spec we specify ManagedIdentity which by default has Both User and System Assign Identity Enums. | ||
# Our service only allows UserAssign Identity and to remove the extra property EnableSystemAssignedIdentity we need to: | ||
# 1. Hide New and Update commands. | ||
# 2. Get the internal version of the commands from CloudHsm.Autorest/internal/ | ||
# 3. Copy the files to CloudHsm.Autorest/internal | ||
# 4. Remove the extra property and build | ||
|
||
- where: | ||
verb: ^New$|^Update$|^Get$|^Backup$|^Restore$|^Get$|^Remove$ | ||
hide: true | ||
|
||
# Make SKU parameter required for New-AzCloudHsm command | ||
- where: | ||
verb: ^New$ | ||
parameter-name: SkuName | ||
required: true | ||
set: | ||
parameter-name: Sku | ||
default: | ||
script: '"Standard_B1"' | ||
|
||
# Rename Backup, Restore, New, Update and Remove commands to remove 'Cluster' prefix from the command name. ex: New-AzCloudHsmCluster to New-AzCloudHsm | ||
- where: | ||
verb: ^Backup$|^Restore$|^New$|^Update$|^Remove$ | ||
subject: '' | ||
set: | ||
subject-prefix: '' | ||
subject: CloudHsm | ||
|
||
# Rename Backup, Restore, New, Update and Remove commands to remove 'Cluster' prefix from the command name. ex: New-AzCloudHsmCluster to New-AzCloudHsm | ||
- where: | ||
verb: ^Backup$|^Restore$ | ||
parameter-name: Name | ||
set: | ||
parameter-name: ClusterName | ||
|
||
# Rename name property of Backup, Restore commands | ||
- where: | ||
verb: ^Backup$|^Restore$ | ||
subject: '' | ||
parameter-name: Name | ||
set: | ||
parameter-name: SkuName | ||
|
||
# Rename property in backup and restore commands | ||
- where: | ||
verb: ^Backup$|^Restore$ | ||
subject: '' | ||
parameter-name: AzureStorageBlobContainerUri | ||
set: | ||
parameter-name: BlobContainerUri | ||
|
||
# Rename Get-CloudHsmClusterBackupStatus commands to Get-CloudHsmBackupStatus | ||
- where: | ||
verb: ^Get$ | ||
subject: CloudHsmClusterBackupStatus | ||
remove: true | ||
|
||
# Rename Get-CloudHsmClusterRestoreStatus commands to Get-CloudHsmRestoreStatus | ||
- where: | ||
verb: ^Get$ | ||
subject: CloudHsmClusterRestoreStatus | ||
remove: true | ||
|
||
# Rename Get-CloudHsmCluster commands to Get-CloudHsm | ||
- where: | ||
verb: ^Get$ | ||
subject: CloudHsmCluster | ||
set: | ||
subject-prefix: '' | ||
subject: CloudHsm | ||
|
||
- where: | ||
parameter-name: SkuName | ||
set: | ||
parameter-name: Sku | ||
|
||
- where: | ||
verb: Update | ||
parameter-name: AutoGeneratedDomainNameLabelScope | ||
hide: true | ||
|
||
- where: | ||
parameter-name: AutoGeneratedDomainNameLabelScope | ||
set: | ||
parameter-name: DomainNameLabelScope | ||
|
||
``` |
17 changes: 17 additions & 0 deletions
17
src/CloudHsm/CloudHsm.Autorest/custom/Az.CloudHsm.custom.psm1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# region Generated | ||
# Load the private module dll | ||
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.CloudHsm.private.dll') | ||
|
||
# Load the internal module | ||
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.CloudHsm.internal.psm1' | ||
if(Test-Path $internalModulePath) { | ||
$null = Import-Module -Name $internalModulePath | ||
} | ||
|
||
# Export nothing to clear implicit exports | ||
Export-ModuleMember | ||
|
||
# Export script cmdlets | ||
Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } | ||
Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) | ||
# endregion |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.