Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
752 changes: 388 additions & 364 deletions src/TimeSeriesInsights/Az.TimeSeriesInsights.format.ps1xml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/TimeSeriesInsights/Az.TimeSeriesInsights.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 5/13/2020
# Generated on: 7/29/2020
#

@{
Expand Down Expand Up @@ -45,7 +45,7 @@ PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
Expand Down Expand Up @@ -122,7 +122,7 @@ PrivateData = @{
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* the first preview release'
# ReleaseNotes = ''

# Prerelease string of this module
# Prerelease = ''
Expand Down
12 changes: 6 additions & 6 deletions src/TimeSeriesInsights/Az.TimeSeriesInsights.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@
$accountsName = 'Az.Accounts'
$accountsModule = Get-Module -Name $accountsName
if(-not $accountsModule) {
$localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
$localAccountsPath = Join-Path $PSScriptRoot 'generated/modules'
if(Test-Path -Path $localAccountsPath) {
$localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
if($localAccounts) {
$accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
}
}
if(-not $accountsModule) {
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.7.4' } | Measure-Object).Count -gt 0
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.8.1' } | Measure-Object).Count -gt 0
if($hasAdequateVersion) {
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.7.4 -Scope Global -PassThru
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.8.1 -Scope Global -PassThru
}
}
}

if(-not $accountsModule) {
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'1.7.4') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'1.8.1') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
}
Write-Information "Loaded Module '$($accountsModule.Name)'"

Expand Down
1 change: 1 addition & 0 deletions src/TimeSeriesInsights/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Upgraded API verision to 2020-05-15

## Version 0.1.0
* the first preview release
Expand Down
4 changes: 2 additions & 2 deletions src/TimeSeriesInsights/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if(-not $Debugger) {
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
}

$dll = Join-Path $PSScriptRoot 'bin\Az.TimeSeriesInsights.private.dll'
$dll = Join-Path $PSScriptRoot 'bin/Az.TimeSeriesInsights.private.dll'
if(-not (Test-Path $dll)) {
Write-Error "Unable to find output assembly in '$binFolder'."
}
Expand All @@ -97,7 +97,7 @@ if(-not (Test-Path $dll)) {
$null = Import-Module -Name $dll

$modulePaths = $dll
$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.TimeSeriesInsights.custom.psm1'
$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.TimeSeriesInsights.custom.psm1'
if(Test-Path $customPsm1) {
$modulePaths = @($dll, $customPsm1)
}
Expand Down
12 changes: 7 additions & 5 deletions src/TimeSeriesInsights/check-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ if(-not $Isolated) {
return
}

function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum) {
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
if($predicate) {
$module = Get-Module -ListAvailable -Name $moduleName
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
$null = New-Item -ItemType Directory -Force -Path $path
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
if($versionMinimum) {
if ($requiredVersion) {
Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
}elseif($versionMinimum) {
Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
} else {
Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
Expand All @@ -39,13 +41,13 @@ function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [
$ProgressPreference = 'SilentlyContinue'
$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1

$localModulesPath = Join-Path $PSScriptRoot 'generated\modules'
$localModulesPath = Join-Path $PSScriptRoot 'generated/modules'
if(Test-Path -Path $localModulesPath) {
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
}

DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.7.4'
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -versionMinimum ''
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.8.1'
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'

$tools = Join-Path $PSScriptRoot 'tools'
$resourceDir = Join-Path $tools 'Resources'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# region Generated
# Load the private module dll
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.TimeSeriesInsights.private.dll')
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.TimeSeriesInsights.private.dll')

# Load the internal module
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.TimeSeriesInsights.internal.psm1'
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.TimeSeriesInsights.internal.psm1'
if(Test-Path $internalModulePath) {
$null = Import-Module -Name $internalModulePath
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Create an environment in the specified subscription and resource group.
https://docs.microsoft.com/en-us/powershell/module/az.timeseriesinsights/new-aztimeseriesinsightsenvironment
#>
function New-AzTimeSeriesInsightsEnvironment {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IEnvironmentResource])]
[CmdletBinding(DefaultParameterSetName='standard', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.IEnvironmentResource])]
[CmdletBinding(DefaultParameterSetName='Gen1', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
[Alias('EnvironmentName')]
Expand All @@ -47,7 +47,7 @@ function New-AzTimeSeriesInsightsEnvironment {
${SubscriptionId},

[Parameter(Mandatory)]
[ArgumentCompleter({param ( $CommandName, $ParameterName, $WordToComplete, $CommandAst, $FakeBoundParameters ) return @('Standard', 'LongTerm')})]
[ArgumentCompleter({param ( $CommandName, $ParameterName, $WordToComplete, $CommandAst, $FakeBoundParameters ) return @('Gen1', 'Gen2')})]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Support.Kind]
# The kind of the environment.
Expand All @@ -59,26 +59,26 @@ function New-AzTimeSeriesInsightsEnvironment {
# The location of the resource.
${Location},

[Parameter(ParameterSetName='standard', Mandatory)]
[Parameter(ParameterSetName='Gen1', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[System.Int32]
# The capacity of the sku.
# For standard environments, this value can be changed to support scale out of environments after they have been created.
# For Gen1 environments, this value can be changed to support scale out of environments after they have been created.
${Capacity},

[Parameter(ParameterSetName='standard', Mandatory)]
[Parameter(ParameterSetName='Gen1', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[System.TimeSpan]
# The data retention time.
${DataRetentionTime},

[Parameter(ParameterSetName='standard')]
[Parameter(ParameterSetName='Gen1')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.ITimeSeriesIdProperty[]]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.ITimeSeriesIdProperty[]]
# The list of event properties which will be used to partition data in the environment.
${PartitionKeyProperty},

[Parameter(ParameterSetName='standard')]
[Parameter(ParameterSetName='Gen1')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[System.String]
# The behavior the Time Series Insights service should take when the environment's capacity has been exceeded
Expand All @@ -91,33 +91,33 @@ function New-AzTimeSeriesInsightsEnvironment {
# The name of this SKU.
${Sku},

[Parameter(ParameterSetName='longterm', Mandatory)]
[Parameter(ParameterSetName='Gen2', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.ITimeSeriesIdProperty[]]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.ITimeSeriesIdProperty[]]
# The list of event properties which will be used to define the environment's time series id.
${TimeSeriesIdProperty},

[Parameter(ParameterSetName='longterm', Mandatory)]
[Parameter(ParameterSetName='Gen2', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[System.String]
# The name of the storage account that will hold the environment's long term data.
${StorageAccountName},

[Parameter(ParameterSetName='longterm', Mandatory)]
[Parameter(ParameterSetName='Gen2', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[System.Security.SecureString]
# The value of the management key that grants the Time Series Insights service write access to the storage account.
${StorageAccountKey},

[Parameter(ParameterSetName='longterm')]
[Parameter(ParameterSetName='Gen2')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[System.TimeSpan]
# ISO8601 timespan specifying the number of days the environment's events will be available for query from the warm store.
${WarmStoreDataRetentionTime},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.ICreateOrUpdateTrackedResourcePropertiesTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.ICreateOrUpdateTrackedResourcePropertiesTags]))]
[System.Collections.Hashtable]
# Key-value pairs of additional properties for the resource.
${Tag},
Expand Down Expand Up @@ -186,9 +186,9 @@ function New-AzTimeSeriesInsightsEnvironment {

process {
try {
if ($PSBoundParameters['Kind'] -eq 'Standard') {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.StandardEnvironmentCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.StandardEnvironmentCreationProperties]::new()
if ($PSBoundParameters['Kind'] -eq 'Gen1') {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.Gen1EnvironmentCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.Gen1EnvironmentCreationProperties]::new()

$Parameter.SkuCapacity = $PSBoundParameters['Capacity']
$null = $PSBoundParameters.Remove('Capacity')
Expand All @@ -206,8 +206,8 @@ function New-AzTimeSeriesInsightsEnvironment {
$null = $PSBoundParameters.Remove('StorageLimitExceededBehavior')
}
} else {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.LongTermEnvironmentCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.LongTermEnvironmentCreationProperties]::new()
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.Gen2EnvironmentCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.Gen2EnvironmentCreationProperties]::new()

$Parameter.Property.StorageConfigurationAccountName = $PSBoundParameters['StorageAccountName']
$null = $PSBoundParameters.Remove('StorageAccountName')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Create an event source under the specified environment.
https://docs.microsoft.com/en-us/powershell/module/az.timeseriesinsights/new-aztimeseriesinsightseventsource
#>
function New-AzTimeSeriesInsightsEventSource {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IEventSourceResource])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.IEventSourceResource])]
[CmdletBinding(DefaultParameterSetName='eventhub', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand Down Expand Up @@ -67,7 +67,7 @@ function New-AzTimeSeriesInsightsEventSource {

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.ICreateOrUpdateTrackedResourcePropertiesTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.ICreateOrUpdateTrackedResourcePropertiesTags]))]
[System.Collections.Hashtable]
# Key-value pairs of additional properties for the resource.
${Tag},
Expand Down Expand Up @@ -172,17 +172,17 @@ function New-AzTimeSeriesInsightsEventSource {
process {
try {
if ($PSBoundParameters['Kind'] -eq 'Microsoft.EventHub') {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.EventHubEventSourceCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.EventHubEventSourceCreationProperties]::new()
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.EventHubEventSourceCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.EventHubEventSourceCreationProperties]::new()

$Parameter.Property.EventHubName = $PSBoundParameters['EventHubName']
$null = $PSBoundParameters.Remove('EventHubName')

$Parameter.Property.ServiceBusNameSpace = $PSBoundParameters['ServiceBusNameSpace']
$null = $PSBoundParameters.Remove('ServiceBusNameSpace')
} else {
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IoTHubEventSourceCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20180815Preview.IoTHubEventSourceCreationProperties]::new()
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.IoTHubEventSourceCreateOrUpdateParameters]::new()
$Parameter.Property = [Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.Api20200515.IoTHubEventSourceCreationProperties]::new()

$Parameter.Property.IoTHubName = $PSBoundParameters['IoTHubName']
$null = $PSBoundParameters.Remove('IoTHubName')
Expand Down
Loading