Skip to content

Commit 4b2ad68

Browse files
authored
Create Az.CloudHsm Module for 2025-03-31 (#27947)
1 parent ad7bf1c commit 4b2ad68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+6301
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
test/*-TestResults.xml
9+
license.txt
10+
/*.ps1
11+
/*.psd1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - CloudHsm")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
<!-- region Generated -->
2+
# Az.CloudHsm
3+
This directory contains the PowerShell module for the CloudHsm service.
4+
5+
---
6+
## Info
7+
- Modifiable: yes
8+
- Generated: all
9+
- Committed: yes
10+
- Packaged: yes
11+
12+
---
13+
## Detail
14+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
15+
16+
## Module Requirements
17+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
18+
19+
## Authentication
20+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
21+
22+
## Development
23+
For information on how to develop for `Az.CloudHsm`, see [how-to.md](how-to.md).
24+
<!-- endregion -->
25+
26+
### AutoRest Configuration
27+
28+
> see https://aka.ms/autorest
29+
30+
```yaml
31+
# pin the swagger version by using the commit id instead of branch name
32+
commit: 55cb134eeb9f92c8df1f6437a9e1130c4c2c4cc5
33+
require:
34+
# readme.azure.noprofile.md is the common configuration file
35+
- $(this-folder)/../../readme.azure.noprofile.md
36+
#- $(repo)/specification/xxx/resource-manager/readme.md
37+
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
38+
# - (this-folder)/relative-path-to-your-local-readme.md
39+
40+
input-file:
41+
- $(repo)/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2025-03-31/cloudhsm.json
42+
try-require:
43+
- $(repo)/specification/hardwaresecuritymodules/resource-manager/readme.powershell.md
44+
45+
# For new RP, the version is 0.1.0
46+
module-version: 0.1.0
47+
# Normally, title is the service name
48+
title: CloudHsm
49+
50+
# 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.
51+
# identity-correction-for-post: true
52+
# resourcegroup-append: true
53+
# nested-object-to-string: true
54+
55+
directive:
56+
# Following are common directives which are normally required in all the RPs
57+
# 1. Remove the unexpanded parameter set
58+
# 2. For New-* cmdlets, ViaIdentity is not required
59+
# Following two directives are v4 specific
60+
- where:
61+
variant: ^(Create|Update)(?!.*?(Expanded))
62+
remove: true
63+
- where:
64+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$|^UpdateViaIdentityExpanded$|^CreateViaJsonString$|^CreateViaJsonFilePath$
65+
remove: true
66+
# Follow directive is v3 specific. If you are using v3, uncomment following directive and comments out two directives above
67+
#- where:
68+
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
69+
# remove: true
70+
71+
#Remove ViaIdentity, ViaIdentityExpaned, JsonString and JsonFilePath commands
72+
- where:
73+
variant: ^(Backup|BackupViaIdentityExpanded|Restore|RestoreViaIdentityExpanded|GetViaIdentity|DeleteViaIdentity)(?!.*?(Expanded))
74+
remove: true
75+
76+
# Remove the set-* cmdlet
77+
- where:
78+
verb: Set
79+
remove: true
80+
81+
# Remove the Private Endpoint cmdlet that are autogenerated
82+
- where:
83+
subject: PrivateEndpointConnection|PrivateLinkResource
84+
remove: true
85+
86+
# Remove the Private Endpoint cmdlet that are autogenerated
87+
- where:
88+
verb: Test
89+
remove: true
90+
91+
# Remove SkuCapacity, EnableSystemAssignedIdentity, PublicNetworkAccess and Token parameters from all commansd
92+
- where:
93+
parameter-name: SkuCapacity|EnableSystemAssignedIdentity|PublicNetworkAccess|Token
94+
hide: true
95+
96+
# Rename CloudHsmClusterName parameter to Name.
97+
- where:
98+
parameter-name: CloudHsmClusterName
99+
set:
100+
parameter-name: Name
101+
102+
# 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.
103+
# Our service only allows UserAssign Identity and to remove the extra property EnableSystemAssignedIdentity we need to:
104+
# 1. Hide New and Update commands.
105+
# 2. Get the internal version of the commands from CloudHsm.Autorest/internal/
106+
# 3. Copy the files to CloudHsm.Autorest/internal
107+
# 4. Remove the extra property and build
108+
109+
- where:
110+
verb: ^New$|^Update$|^Get$|^Backup$|^Restore$|^Get$|^Remove$
111+
hide: true
112+
113+
# Make SKU parameter required for New-AzCloudHsm command
114+
- where:
115+
verb: ^New$
116+
parameter-name: SkuName
117+
required: true
118+
set:
119+
parameter-name: Sku
120+
default:
121+
script: '"Standard_B1"'
122+
123+
# Rename Backup, Restore, New, Update and Remove commands to remove 'Cluster' prefix from the command name. ex: New-AzCloudHsmCluster to New-AzCloudHsm
124+
- where:
125+
verb: ^Backup$|^Restore$|^New$|^Update$|^Remove$
126+
subject: ''
127+
set:
128+
subject-prefix: ''
129+
subject: CloudHsm
130+
131+
# Rename Backup, Restore, New, Update and Remove commands to remove 'Cluster' prefix from the command name. ex: New-AzCloudHsmCluster to New-AzCloudHsm
132+
- where:
133+
verb: ^Backup$|^Restore$
134+
parameter-name: Name
135+
set:
136+
parameter-name: ClusterName
137+
138+
# Rename name property of Backup, Restore commands
139+
- where:
140+
verb: ^Backup$|^Restore$
141+
subject: ''
142+
parameter-name: Name
143+
set:
144+
parameter-name: SkuName
145+
146+
# Rename property in backup and restore commands
147+
- where:
148+
verb: ^Backup$|^Restore$
149+
subject: ''
150+
parameter-name: AzureStorageBlobContainerUri
151+
set:
152+
parameter-name: BlobContainerUri
153+
154+
# Rename Get-CloudHsmClusterBackupStatus commands to Get-CloudHsmBackupStatus
155+
- where:
156+
verb: ^Get$
157+
subject: CloudHsmClusterBackupStatus
158+
remove: true
159+
160+
# Rename Get-CloudHsmClusterRestoreStatus commands to Get-CloudHsmRestoreStatus
161+
- where:
162+
verb: ^Get$
163+
subject: CloudHsmClusterRestoreStatus
164+
remove: true
165+
166+
# Rename Get-CloudHsmCluster commands to Get-CloudHsm
167+
- where:
168+
verb: ^Get$
169+
subject: CloudHsmCluster
170+
set:
171+
subject-prefix: ''
172+
subject: CloudHsm
173+
174+
- where:
175+
parameter-name: SkuName
176+
set:
177+
parameter-name: Sku
178+
179+
- where:
180+
verb: Update
181+
parameter-name: AutoGeneratedDomainNameLabelScope
182+
hide: true
183+
184+
- where:
185+
parameter-name: AutoGeneratedDomainNameLabelScope
186+
set:
187+
parameter-name: DomainNameLabelScope
188+
189+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# region Generated
2+
# Load the private module dll
3+
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.CloudHsm.private.dll')
4+
5+
# Load the internal module
6+
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.CloudHsm.internal.psm1'
7+
if(Test-Path $internalModulePath) {
8+
$null = Import-Module -Name $internalModulePath
9+
}
10+
11+
# Export nothing to clear implicit exports
12+
Export-ModuleMember
13+
14+
# Export script cmdlets
15+
Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
16+
Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias)
17+
# endregion

0 commit comments

Comments
 (0)