If you need to test a symlink

The Usage API doesn't offer a direct method to test a symlink. However, you can do it using edge delivery by making a HEAD request, rather than performing an upload via this API.

While this is the simplest course of action, it has limitations--namely, it has specific requirements for use:

  • Delivery name. You must know the specific delivery name to use to obtain the Header file.
  • Location of the header file. You must know the complete path to, and name of the applicable HTTP header file.
  • Download access. You must have access to download content via NetStorage.

The HEAD request

curl -I http://[Delivery Name]/[Path]/[File]

Request variables

  • [Delivery Name]. The appropriate edge delivery “Delivery name”. For example, ssdns.mycompany.test.edgesuite.net
  • [Path]. The complete path, including all sub-directories (if applicable), to the HTTP Header file.
  • [File]. The filename (including the extension) of the HTTP Header file.

Example

curl -I http://ssdns.mycompany.test.edgesuite.net/test/QueryMon.dmg

Response example for testing "symlink"

HTTP/1.1 200 OK 
Server: Apache 
ETag: "df02a044269f0131b6fd1737aa59d284:1429578978" 
Last-Modified: Tue, 21 Apr 2015 01:16:18 GMT 
Accept-Ranges: bytes 
Content-Length: 3213702 
Content-Type: application/octet-stream 
Date: Tue, 09 Jun 2015 22:59:57 GMT

You can gather the header from the ETag in the response. This contains the object MD5 in hex format. This is all content that precedes the colon (“:”) in the response. All content after the colon is a hex of the approximate upload time.