Public/Get-NicRuDnsZoneRevisionData.ps1
<#
.SYNOPSIS Get current DNS zone data .DESCRIPTION Получение текущего файла зоны для домена .PARAMETER Service DNS hosting service name .PARAMETER ZoneName DNS Zone name .PARAMETER Revision Revision ID .PARAMETER AccessToken Access token to use .LINK https://www.nic.ru/help/upload/file/API_DNS-hosting.pdf #> function Get-NicRuDnsZoneRevisionData { [CmdletBinding()] param( [Parameter(Mandatory)] [string]$Service, [Parameter(Mandatory)] [string]$ZoneName, [Parameter(Mandatory)] [string]$Revision, [string]$AccessToken ) if (-not $AccessToken) { $AccessToken = if ($GMNicRuDefaultToken) { $GMNicRuDefaultToken.access_token } else { $null } } if (-not $AccessToken) { throw "AccessToken required" } $Headers = @{ "Authorization" = "Bearer $AccessToken" } $requestParams = @{ Uri = "https://api.nic.ru/dns-master/services/$Service/zones/$(Get-Punycode $ZoneName)/revisions/$Revision" Headers = $Headers ContentType = "application/json; charset=utf-8" Method = 'GET' } Write-Verbose $requestParams.Uri $r = Invoke-RestMethod @requestParams @GMNicRuProxySettings $r } |