|
| 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 | +``` |
0 commit comments