Open JG237 opened 6 days ago
Hi @JG237 ,
Please describe your use case in more detail. I am especially curious about the 10 minutes. It is 10 minutes after what event? If you are running this in a script then please share your code if possible.
The function seems to work as expected in general.
Hi @michal-krobicki-akamai
I can connect to Akamai and run any of the get-Edns* command and I get results fine It is only the Get-EdnsZoneTransferStatus that has this error. After "5-10" minutes it just starts working with no issues. I don't change anything. Then works until I close the PS session
What is the @testParams you are using
Here is a cutdown version of the script I am running. New-AkamaiSession -ClientSecret $clientsec -HostName $myhost -ClientAccessToken $myaccesstoken -ClientToken $myclienttoken $akamaiDNSSec = Get-EdnsZone | where {$.type -match "secondary"} Foreach ($DNSAkaSec in $akamaiDNS_Sec) { $transferinfo = Get-EdnsZoneTransferStatus -Zones $($DNSAkaSec.zone) $tranmstip = $transferinfo.masters.masterip $AkaSOASer = $transferinfo.metadata.lastSuccessSerial write-host "$($DNSAkaSec.zone) - $AkaSOASer" }
Hi @JG237,
Get-EdnsZoneTransferStatus
is different as it uses POST.Invoke-AkamaiRestMethod
from Akamai.Common behind the scenes, which is responsible for authorization, HTTP header management etc.
The error in your screenshot suggests that the function fails due to Expect: 100 - Continue
HTTP header being present in your request.
It is a known scenario with Akamai OpenAPIs and Invoke-AkamaiRestMethod
includes code to disable that header for all POST and PUT calls: # Add additional headers if POSTing or PUTing
If ($Body) {
# turn off the "Expect: 100 Continue" header
# as it's not supported on the Akamai side.
[System.Net.ServicePointManager]::Expect100Continue = $false
}
Can you think of any reason how such header may be added to your request? Is there a proxy that modifies your requests and adds it? What is the PowerShell version you are using to run your code? Can you test the script from a different machine / network?
For me it is very strange as it only occurs for the first 5-10 minutes of the session the rest of the day it is 100% fine. Access should not change Also PS command don't change. I tested on 3 machines and get the same result.
PSVersion 5.1.20348.2400
Hi, When I first connect to Akamai I can not run the Get-EdnsZoneTransferStatus for about 10 minutes every other command works
status 417 Expect 100-contiune header is not supported