manifests/collectors/Databases/MariaDB.psd1
|
# # GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Databases/MariaDB.ps1 (AB#5660). # Field expressions are copied verbatim from the original collector and evaluate in an # equivalent scope -- see docs/design/decisions/declarative-collectors.md. # Review before trusting; regenerate rather than hand-patch if the source collector changes. # @{ ResourceTypes = @( 'microsoft.dbformariadb/servers' ) AdditionalFilter = $null RowLoopVariable = '1' Preamble = @' $ResUCount = 1 $sub1 = $SUB | Where-Object { $_.id -eq $1.subscriptionId } $data = $1.PROPERTIES $Retired = $Retirements | Where-Object { $_.id -eq $1.id } if ($Retired) { $RetiredFeature = foreach ($Retire in $Retired) { $RetiredServiceID = $Unsupported | Where-Object {$_.Id -eq $Retired.ServiceID} $tmp0 = [pscustomobject]@{ 'RetiredFeature' = $RetiredServiceID.RetiringFeature 'RetiredDate' = $RetiredServiceID.RetirementDate } $tmp0 } $RetiringFeature = if (@($RetiredFeature.RetiredFeature).count -gt 1) { $RetiredFeature.RetiredFeature | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredFeature} $RetiringFeature = [string]$RetiringFeature $RetiringFeature = if ($RetiringFeature -like '* ,*') { $RetiringFeature -replace ".$" }else { $RetiringFeature } $RetiringDate = if (@($RetiredFeature.RetiredDate).count -gt 1) { $RetiredFeature.RetiredDate | ForEach-Object { $_ + ' ,' } }else { $RetiredFeature.RetiredDate} $RetiringDate = [string]$RetiringDate $RetiringDate = if ($RetiringDate -like '* ,*') { $RetiringDate -replace ".$" }else { $RetiringDate } } else { $RetiringFeature = $null $RetiringDate = $null } if(!$data.privateEndpointConnections){$PVTENDP = $false}else{$PVTENDP = $data.privateEndpointConnections.Id.split("/")[8]} $sku = $1.SKU $Tags = if(![string]::IsNullOrEmpty($1.tags.psobject.properties)){$1.tags.psobject.properties}else{'0'} '@ AdditionalRowLoops = @() Fields = @( @{ Name = 'ID' Expression = '$1.id' } @{ Name = 'Subscription' Expression = '$sub1.Name' } @{ Name = 'Resource Group' Expression = '$1.RESOURCEGROUP' } @{ Name = 'Name' Expression = '$1.NAME' } @{ Name = 'Location' Expression = '$1.LOCATION' } @{ Name = 'Retiring Feature' Expression = '$RetiringFeature' } @{ Name = 'Retiring Date' Expression = '$RetiringDate' } @{ Name = 'SKU' Expression = '$sku.name' } @{ Name = 'SKU Family' Expression = '$sku.family' } @{ Name = 'Tier' Expression = '$sku.tier' } @{ Name = 'Capacity' Expression = '$sku.capacity' } @{ Name = 'MariaDB Version' Expression = '$data.version' } @{ Name = 'Private Endpoint' Expression = '$PVTENDP' } @{ Name = 'Backup Retention Days' Expression = '$data.storageProfile.backupRetentionDays' } @{ Name = 'Geo-Redundant Backup' Expression = '$data.storageProfile.geoRedundantBackup' } @{ Name = 'Auto Grow' Expression = '$data.storageProfile.storageAutogrow' } @{ Name = 'Storage MB' Expression = '$data.storageProfile.storageMB' } @{ Name = 'Public Network Access' Expression = '$data.publicNetworkAccess' } @{ Name = 'Admin Login' Expression = '$data.administratorLogin' } @{ Name = 'Infrastructure Encryption' Expression = '$data.InfrastructureEncryption' } @{ Name = 'Minimum TLS Version' Expression = '"$($data.minimalTlsVersion -Replace ''_'', ''.'' -Replace ''tls'', ''TLS'')"' } @{ Name = 'State' Expression = '$data.userVisibleState' } @{ Name = 'Replica Capacity' Expression = '$data.replicaCapacity' } @{ Name = 'Replication Role' Expression = '$data.replicationRole' } @{ Name = 'BYOK Enforcement' Expression = '$data.byokEnforcement' } @{ Name = 'SSL Enforcement' Expression = '$data.sslEnforcement' } @{ Name = 'Resource U' Expression = '$ResUCount' } @{ Name = 'Tag Name' Expression = '[string]$Tag.Name' } @{ Name = 'Tag Value' Expression = '[string]$Tag.Value' } ) Export = @{ WorksheetName = 'MariaDB' TableNamePrefix = 'MariaDBTable_' Columns = @( 'Subscription' 'Resource Group' 'Name' 'Location' 'Retiring Feature' 'Retiring Date' 'SKU' 'SKU Family' 'Tier' 'Capacity' 'MariaDB Version' 'Private Endpoint' 'Backup Retention Days' 'Geo-Redundant Backup' 'Auto Grow' 'Storage MB' 'Public Network Access' 'Admin Login' 'Infrastructure Encryption' 'Minimum TLS Version' 'State' 'Replica Capacity' 'Replication Role' 'BYOK Enforcement' 'SSL Enforcement' 'Resource U' ) TagColumns = @( 'Tag Name' 'Tag Value' ) TagColumnsBefore = 'Resource U' NumberFormat = '0.0' ConditionalText = @( 'New-ConditionalText FALSE -Range L:L' 'New-ConditionalText Disabled -Range N:N' 'New-ConditionalText Enabled -Range Q:Q' 'New-ConditionalText TLSEnforcementDisabled -Range T:T' 'New-ConditionalText Disabled -Range Y:Y' 'New-ConditionalText -Range E2:E100 -ConditionalType ContainsText' ) } SourceCollector = 'Modules/Public/InventoryModules/Databases/MariaDB.ps1' } |