A purge is the method to remove your content from the edge servers, and to force Edgecast to get fresh content from your origin.
Your content can be purged manually, but Edgecast supports an API to purge your content.
All API calls are documented in the Edgecast Web Services Guide
This is an example to purge via a windows command script. In order for the example to work, you must allow the user to purge as well as allow API access.
You also need your Hex account number. This hexadecimal number can be found in the upper-right hand corner of the dashboard.
Create a text file called ECconfig.txt and place your credentials inside
MyToken=007ghg56bd-XXXX-YYYY-9f75-c55c73d7vvc8cf2 HEX=C16C
Windows script
:: Sample usage: :: purge-edgecast.bat http://cdn.mydomain.com/content/testapi.txt @echo off @setlocal :: Set MyToken and HEX variables from config file for /f "delims=" %%x in (ECconfig.txt) do (set "%%x") set APIendpoint=https://api.edgecast.com set FlashMediaStreaming=2 set HTTPLarge=3 set HTTPSmall=8 set ADN=14 set URL=%1 set Platform=%HTTPLarge% curl -s -H "Authorization: tok:%MyToken%" -H "Accept: application/json" -H "Content-Type: application/json" -X PUT -d "{ ""MediaPath"":""%URL%"", ""MediaType"":%Platform% }" %APIendpoint%/v2/mcc/customers/%HEX%/edge/purge :finish echo.
Linux Script
#!/bin/bash # Sample usage: # purge-edgecast.sh http://cdn.mydomain.com/content/testapi.txt # Set MyToken and HEX variables from config file source ECconfig.txt APIendpoint=https://api.edgecast.com FlashMediaStreaming=2 HTTPLarge=3 HTTPSmall=8 ADN=14 URL=$1 Platform=$HTTPLarge curl -s -H "Authorization: tok:$MyToken" -H 'Accept: application/json' -H 'Content-Type: application/json' -X PUT -d "{ \"MediaPath\":\"$URL\", \"MediaType\":$Platform }" $APIendpoint/v2/mcc/customers/$HEX/edge/purge # finish
Comments
0 comments
Please sign in to leave a comment.