Skip to content

Commit

Permalink
adapt
Browse files Browse the repository at this point in the history
  • Loading branch information
VeryEarly committed Sep 30, 2024
1 parent 395f800 commit c4fe23b
Show file tree
Hide file tree
Showing 181 changed files with 3,241 additions and 999 deletions.
1 change: 1 addition & 0 deletions src/Storage/Storage.Autorest/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
18 changes: 18 additions & 0 deletions src/Storage/Storage.Autorest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
bin
obj
.vs
generated
internal
exports
tools
custom/*.psm1
custom/autogen-model-cmdlets
test/*-TestResults.xml
license.txt
/*.ps1
/*.psd1
/*.ps1xml
/*.psm1
/*.snk
/*.csproj
/*.nuspec
43 changes: 27 additions & 16 deletions src/Storage/Storage.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
// 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,
// 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.

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Microsoft Azure Powershell - Storage")]
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("5.9.1.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("5.9.1+395f800870cc557498801081c463d8a80bd28607")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Storage")]
[assembly: System.Reflection.AssemblyVersionAttribute("5.9.1.0")]

// Generated by the MSBuild WriteCodeFragment class.


[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
[assembly: Guid("88ce5e76-b817-4949-b354-bec022eb6e77")]
[assembly: AssemblyVersion("7.3.1")]
[assembly: AssemblyFileVersion("7.3.1")]
35 changes: 32 additions & 3 deletions src/Storage/Storage.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
# is regenerated.
# ----------------------------------------------------------------------------------
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX)
param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX, [Switch]$DisableAfterBuildTasks)
$ErrorActionPreference = 'Stop'

if($PSEdition -ne 'Core') {
Expand Down 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 All @@ -97,6 +99,24 @@ if(-not $Debugger) {
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
}

if ($isAzure -And 'Properties/AssemblyInfo.cs') {
$assemblyInfoPath = Join-Path $PSScriptRoot 'Properties/AssemblyInfo.cs'
$header = '// 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.'
$content = $header + [Environment]::NewLine + [Environment]::NewLine + (Get-Content $assemblyInfoPath -Raw)
$content | Set-Content $assemblyInfoPath -Force
}

$dll = Join-Path $PSScriptRoot 'bin\Az.Storage.private.dll'
if(-not (Test-Path $dll)) {
Write-Error "Unable to find output assembly in '$binFolder'."
Expand Down Expand Up @@ -151,7 +171,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 All @@ -177,4 +197,13 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

Write-Host -ForegroundColor Green '-------------Done-------------'
if (-not $DisableAfterBuildTasks){
$afterBuildTasksPath = Join-Path $PSScriptRoot '../../../tools/BuildScripts/AdaptAutorestModule.ps1'
$afterBuildTasksArgs = ConvertFrom-Json '{"SubModuleName":"Storage","ModuleRootName":"$(root-module-name)"}' -AsHashtable
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
Write-Host -ForegroundColor Green 'Running after build tasks...'
. $afterBuildTasksPath @afterBuildTasksArgs
}
}

Write-Host -ForegroundColor Green '-------------Done-------------'
4 changes: 2 additions & 2 deletions src/Storage/Storage.Autorest/docs/Az.Storage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Storage
Module Guid: 14995ab3-8dd3-4201-b5f5-9dc94eac60d4
Module Guid: 4fa0f359-2aa8-48a3-8eaa-2d05c4f67a9c
Download Help Link: https://learn.microsoft.com/powershell/module/az.storage
Help Version: 1.0.0.0
Locale: en-US
Expand All @@ -16,6 +16,6 @@ Gets the status of the ongoing migration for the specified storage account.

### [Start-AzStorageAccountMigration](Start-AzStorageAccountMigration.md)
Account Migration request can be triggered for a storage account to change its redundancy level.
The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability.
The migration customer the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability.
Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ schema: 2.0.0

## SYNOPSIS
Account Migration request can be triggered for a storage account to change its redundancy level.
The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability.
The migration customer the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability.
Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.

## SYNTAX
Expand Down Expand Up @@ -44,7 +44,7 @@ Start-AzStorageAccountMigration -AccountName <String> -ResourceGroupName <String

## DESCRIPTION
Account Migration request can be triggered for a storage account to change its redundancy level.
The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability.
The migration customer the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability.
Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.

## EXAMPLES
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Storage.Autorest/generate-info.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"generate_Id": "694a23ef-e629-4bf4-817e-3e02dd7eefc3"
"generate_Id": "6a5bd051-9641-4c9b-9a8a-4209136d3a40"
}
11 changes: 11 additions & 0 deletions src/Storage/Storage.Autorest/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Resources
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder.

## Info
- Modifiable: yes
- Generated: no
- Committed: yes
- Packaged: no

## Purpose
Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact.
16 changes: 8 additions & 8 deletions src/Storage/Storage.Management/Az.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 9/5/2024
# Generated on: 9/30/2024
#

@{
Expand Down Expand Up @@ -62,6 +62,7 @@ RequiredAssemblies = 'Azure.Data.Tables.dll', 'Azure.Storage.Blobs.dll',
'Microsoft.Azure.Cosmos.Table.dll',
'Microsoft.Azure.DocumentDB.Core.dll',
'Microsoft.Azure.KeyVault.Core.dll',
'Microsoft.Azure.PowerShell.Storage.Common.dll',
'Microsoft.Azure.PowerShell.Storage.Management.Sdk.dll',
'Microsoft.Azure.Storage.Blob.dll',
'Microsoft.Azure.Storage.Common.dll',
Expand All @@ -70,17 +71,16 @@ RequiredAssemblies = 'Azure.Data.Tables.dll', 'Azure.Storage.Blobs.dll',
'Microsoft.Azure.Storage.Queue.dll', 'Microsoft.OData.Core.dll',
'Microsoft.OData.Edm.dll', 'Microsoft.Spatial.dll',
'Storage.Autorest/bin/Az.Storage.private.dll',
'System.IO.Hashing.dll',
'Microsoft.Azure.PowerShell.Storage.Common.dll'
'System.IO.Hashing.dll'

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

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

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = 'Storage.Autorest\Az.Storage.format.ps1xml',
FormatsToProcess = 'Storage.Autorest/Az.Storage.format.ps1xml',
'Storage.format.ps1xml', 'Storage.generated.format.ps1xml',
'Storage.Management.format.ps1xml'

Expand Down Expand Up @@ -231,7 +231,7 @@ PrivateData = @{
PSData = @{

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

# A URL to the license for this module.
LicenseUri = 'https://aka.ms/azps-license'
Expand All @@ -257,7 +257,7 @@ PrivateData = @{

} # End of PSData hashtable

} # End of PrivateData hashtable
} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ Adds legal hold tags to a Storage blob container
```
Add-AzRmStorageContainerLegalHold [-ResourceGroupName] <String> [-StorageAccountName] <String> -Name <String>
-Tag <String[]> [-AllowProtectedAppendWriteAll <Boolean>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### AccountObject
```
Add-AzRmStorageContainerLegalHold -Name <String> -StorageAccount <PSStorageAccount> -Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

### ContainerObject
```
Add-AzRmStorageContainerLegalHold -Container <PSContainer> -Tag <String[]>
[-AllowProtectedAppendWriteAll <Boolean>] [-DefaultProfile <IAzureContextContainer>]
[-WhatIf] [-Confirm] [<CommonParameters>]
[-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -123,6 +123,21 @@ Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
### -ProgressAction
{{ Fill ProgressAction Description }}
```yaml
Type: System.Management.Automation.ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ResourceGroupName
Resource Group Name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ Adds an action to the input ManagementPolicy Action Group object, or creates a M
```
Add-AzStorageAccountManagementPolicyAction -BaseBlobAction <String> -DaysAfterModificationGreaterThan <Int32>
[-DaysAfterLastTierChangeGreaterThan <Int32>] [-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
[-DefaultProfile <IAzureContextContainer>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### BaseBlobLastAccessTime
```
Add-AzStorageAccountManagementPolicyAction -BaseBlobAction <String> -DaysAfterLastAccessTimeGreaterThan <Int32>
[-EnableAutoTierToHotFromCool] [-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
[-DefaultProfile <IAzureContextContainer>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### BaseBlobCreationTime
```
Add-AzStorageAccountManagementPolicyAction -BaseBlobAction <String> -DaysAfterCreationGreaterThan <Int32>
[-InputObject <PSManagementPolicyActionGroup>] [-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
[-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### Snapshot
```
Add-AzStorageAccountManagementPolicyAction -SnapshotAction <String> -DaysAfterCreationGreaterThan <Int32>
[-DaysAfterLastTierChangeGreaterThan <Int32>] [-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
[-DefaultProfile <IAzureContextContainer>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

### BlobVersion
```
Add-AzStorageAccountManagementPolicyAction -BlobVersionAction <String> -DaysAfterCreationGreaterThan <Int32>
[-DaysAfterLastTierChangeGreaterThan <Int32>] [-InputObject <PSManagementPolicyActionGroup>]
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
[-DefaultProfile <IAzureContextContainer>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -292,6 +292,21 @@ Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -ProgressAction
{{ Fill ProgressAction Description }}
```yaml
Type: System.Management.Automation.ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SnapshotAction
The management policy action for snapshot.
Expand Down
Loading

0 comments on commit c4fe23b

Please sign in to comment.