api-definitions/Get-APIEndpointVersionGZipSettings.ps1
function Get-APIEndpointVersionGZipSettings { Param( [Parameter(Mandatory=$true, ParameterSetName="name")] [string] $APIEndpointName, [Parameter(Mandatory=$true, ParameterSetName="id")] [int] $APIEndpointID, [Parameter(Mandatory=$true)] [string] $VersionNumber, [Parameter(Mandatory=$false)] [string] $EdgeRCFile = '~\.edgerc', [Parameter(Mandatory=$false)] [string] $Section = 'default', [Parameter(Mandatory=$false)] [string] $AccountSwitchKey ) if($APIEndpointName){ $APIEndpointID = (List-APIEndpoints -Contains $APIEndpointName -PageSize 1 -EdgeRCFile $EdgeRCFile -Section $Section -AccountSwitchKey $AccountSwitchKey).apiEndPointId } if($VersionNumber.ToLower() -eq "latest"){ $VersionNumber = (List-APIEndpointVersions -APIEndpointID $APIEndpointID -EdgeRCFile $EdgeRCFile -Section $Section -AccountSwitchKey $AccountSwitchKey | Sort-Object -Property versionNumber -Descending)[0].versionNumber } $Path = "/api-definitions/v2/endpoints/$APIEndpointID/versions/$VersionNumber/settings/gzip?accountSwitchKey=$AccountSwitchKey" try { $Result = Invoke-AkamaiRestMethod -Method GET -Path $Path -EdgeRCFile $EdgeRCFile -Section $Section return $Result } catch { throw $_.Exception } } |