CDN¶
/api/1.2/cdns¶
GET /api/1.2/cdns
Authentication Required: Yes
Role(s) Required: None
Response Properties
Parameter Type Description idstring CDN id. namestring CDN name. domainNamestring TLD of the CDN. dnssecEnabledbool DNSSEC enabled. lastUpdatedstring Response Example
{ "response": [ { "id": "1" "name": "cdn1", "domainName": "cdn1.foo.com", "dnssecEnabled": false, "lastUpdated": "2014-10-02 08:22:43" }, { "id": "2" "name": "cdn2", "domainName": "cdn2.foo.com", "dnssecEnabled": true, "lastUpdated": "2014-10-02 08:22:43" } ] }
GET /api/1.2/cdns/:id
Authentication Required: Yes
Role(s) Required: None
Request Route Parameters
Name Required Description idyes CDN id. Response Properties
Parameter Type Description idstring CDN id. namestring CDN name. domainNamestring TLD of the CDN. dnssecEnabledbool DNSSEC enabled. lastUpdatedstring Response Example
{ "response": [ { "id": "2" "name": "cdn2", "domainName": "cdn2.foo.com", "dnssecEnabled": false, "lastUpdated": "2014-10-02 08:22:43" } ] }
GET /api/1.2/cdns/name/:name
Authentication Required: Yes
Role(s) Required: None
Request Route Parameters
Name Required Description nameyes CDN name. Response Properties
Parameter Type Description idstring CDN id. namestring CDN name. domainNamestring TLD of the CDN. dnssecEnabledbool DNSSEC enabled. lastUpdatedstring Response Example
{ "response": [ { "id": "2" "name": "cdn2", "domainName": "cdn2.foo.com", "dnssecEnabled": false, "lastUpdated": "2014-10-02 08:22:43" } ] }
POST /api/1.2/cdns
Allows user to create a CDN.
Authentication Required: Yes
Role(s) Required: admin or oper
Request Parameters
Parameter Type Description namestring CDN name. domainNamestring TLD of the CDN. dnssecEnabledbool Whether dnssec is enabled. - false: disabled - true: enabled Request Example
{ "name": "cdn_test", "domainName": "cdn3.foo.com", "dnssecEnabled": true }Response Properties
Parameter Type Description responsehash The details of the creation, if success. >idint CDN id. >namestring CDN name. >dnssecEnabledstring Whether dnssec is enabled. >domainNamestring TLD of the CDN. alertsarray A collection of alert messages. >levelstring Success, info, warning or error. >textstring Alert message. Response Example
{ "response":{ "id": 3 "name": "cdn_test", "domainName": "cdn3.foo.com", "dnssecEnabled": true }, "alerts":[ { "level": "success", "text": "cdn was created." } ] }
PUT /api/1.2/cdns/{:id}
Allows user to edit a CDN.
Authentication Required: Yes
Role(s) Required: admin or oper
Request Route Parameters
Name Type Description idint CDN id. Request Properties
Parameter Type Description namestring CDN name. domainNamestring TLD of the CDN. dnssecEnabledbool Whether dnssec is enabled. - false: disabled - true: enabled Request Example
{ "name": "cdn_test2", "domainName": "cdn3.foo.com", "dnssecEnabled": false }Response Properties
Parameter Type Description responsehash The details of the update, if success. >namestring CDN name. >idint CDN id. >domainNamestring TLD of the CDN. >dnssecEnabledbool Whether dnssec is enabled. alertsarray A collection of alert messages. >levelstring Success, info, warning or error. >textstring Alert message. Response Example
{ "response":{ "id": 3, "name": "cdn_test2", "domainName": "cdn3.foo.com", "dnssecEnabled": false }, "alerts":[ { "level": "success", "text": "cdn was updated." } ] }
DELETE /api/1.2/cdns/{:id}
Allows user to delete a CDN.
Authentication Required: Yes
Role(s) Required: admin or oper
Request Route Parameters
Name Required Description idyes CDN id. Response Properties
Parameter Type Description alertsarray A collection of alert messages. >levelstring success, info, warning or error. >textstring Alert message. Response Example
{ "alerts": [ { "level": "success", "text": "cdn was deleted." } ], }
POST /api/1.2/cdns/{:id}/queue_update
Queue or dequeue updates for all servers assigned to a specific CDN.
Authentication Required: Yes
Role(s) Required: admin or oper
Request Route Parameters
Name Required Description id yes the cdn id. Request Properties
Name Type Description action string queue or dequeue Request Example
{ "action": "queue" }Response Properties
Name Type Description action string The action processed, queue or dequeue. cdnId integer cdn id Response Example
{ "response": { "action": "queue", "cdn": 1 } }
Health¶
GET /api/1.2/cdns/health
Retrieves the health of all locations (cache groups) for all CDNs.
Authentication Required: Yes
Role(s) Required: None
Response Properties
Parameter Type Description totalOnlineint Total number of online caches across all CDNs. totalOfflineint Total number of offline caches across all CDNs. cachegroupsarray A collection of cache groups. >onlineint The number of online caches for the cache group >offlineint The number of offline caches for the cache group. >namestring Cache group name. Response Example
{ "response": { "totalOnline": 148, "totalOffline": 0, "cachegroups": [ { "online": 8, "offline": 0, "name": "us-co-denver" }, { "online": 7, "offline": 0, "name": "us-de-newcastle" } ] }, }
GET /api/1.2/cdns/:name/health
Retrieves the health of all locations (cache groups) for a given CDN.
Authentication Required: Yes
Role(s) Required: None
Request Route Parameters
Name Required Description nameyes Response Properties
Parameter Type Description totalOnlineint Total number of online caches across the specified CDN. totalOfflineint Total number of offline caches across the specified CDN. cachegroupsarray A collection of cache groups. >onlineint The number of online caches for the cache group >offlineint The number of offline caches for the cache group. >namestring Cache group name. Response Example
{ "response": { "totalOnline": 148, "totalOffline": 0, "cachegroups": [ { "online": 8, "offline": 0, "name": "us-co-denver" }, { "online": 7, "offline": 0, "name": "us-de-newcastle" } ] }, }
GET /api/1.2/cdns/usage/overview
Retrieves the high-level CDN usage metrics.
Authentication Required: Yes
Role(s) Required: None
Response Properties
Parameter Type Description currentGbpsnumber tpsint maxGbpsint Response Example
{ "response": { "currentGbps": 149.368167, "tps": 36805, "maxGbps": 3961 } }
GET /api/1.2/cdns/capacity
Retrieves the aggregate capacity percentages of all locations (cache groups) for a given CDN.
Authentication Required: Yes
Role(s) Required: None
Response Properties
Parameter Type Description availablePercentnumber unavailablePercentnumber utilizedPercentnumber maintenancePercentnumber Response Example
{ "response": { "availablePercent": 89.0939840205533, "unavailablePercent": 0, "utilizedPercent": 10.9060020300395, "maintenancePercent": 0.0000139494071146245 } }
Routing¶
GET /api/1.2/cdns/routing
Retrieves the aggregate routing percentages of all locations (cache groups) for a given CDN.
Authentication Required: Yes
Role(s) Required: None
Response Properties
Parameter Type Description staticRoutenumber Used pre-configured DNS entries. missnumber No location available for client IP. geonumber Used 3rd party geo-IP mapping. errnumber Error localizing client IP. cznumber Used Coverage Zone geo-IP mapping. dsrnumber Overflow traffic sent to secondary CDN. Response Example
{ "response": { "staticRoute": 0, "miss": 0, "geo": 37.8855391018869, "err": 0, "cz": 62.1144608981131, "dsr": 0 } }
Metrics¶
GET /api/1.2/cdns/metric_types/:metric/start_date/:start/end_date/:end
Note: this route is not currently implemented in Traffic Ops. See https://github.com/apache/incubator-trafficcontrol/issues/2309
Retrieves edge metrics of one or all locations (cache groups).
Authentication Required: Yes
Role(s) Required: None
Request Route Parameters
Name Required Description metric_typeyes ooff, origin_tps startyes UNIX time, yesterday, now endyes UNIX time, yesterday, now Response Properties
Parameter Type Description statshash >countstring >98thPercentilestring >minstring >maxstring >5thPercentilestring >95thPercentilestring >meanstring >sumstring dataarray >timeint >valuenumber labelstring Response Example
{ "response": [ { "stats": { "count": 1, "98thPercentile": 1668.03, "min": 1668.03, "max": 1668.03, "5thPercentile": 1668.03, "95thPercentile": 1668.03, "mean": 1668.03, "sum": 1668.03 }, "data": [ [ 1425135900000, 1668.03 ], [ 1425136200000, null ] ], "label": "Origin TPS" } ], }
Domains¶
GET /api/1.2/cdns/domains
Authentication Required: Yes
Role(s) Required: None
Response Properties
Parameter Type Description profileIdstring parameterIdstring profileNamestring profileDescriptionstring domainNamestring Response Example
{ "response": [ { "profileId": "5", "parameterId": "404", "profileName": "CR_FOO", "profileDescription": "Content Router for foo.domain.net", "domainName": "foo.domain.net" }, { "profileId": "8", "parameterId": "405", "profileName": "CR_BAR", "profileDescription": "Content Router for bar.domain.net", "domainName": "bar.domain.net" } ], }
Topology¶
GET /api/1.2/cdns/:cdn_name/configs
Retrieves CDN config information.
Authentication Required: Yes
Request Route Parameters
Name Required Description cdn_nameyes Your cdn name or, all Response Properties
Parameter Type Description idstring valuestring namestring config_filestring Response Example
TBD
GET /api/1.2/cdns/:name/configs/monitoring
Retrieves CDN monitoring information.
Authentication Required: Yes
Role(s) Required: None
Request Route Parameters
Name Required Description nameyes CDN name Response Properties
Parameter Type Description trafficServersarray A collection of Traffic Servers. >profilestring >ipstring >statusstring >cacheGroupstring >ip6string >portint >hostNamestring >fqdnstring >interfaceNamestring >typestring >hashIdstring cacheGroupsarray A collection of cache groups. >coordinateshash >>longitudenumber >>latitudenumber >namestring confighash >hack.ttlint >tm.healthParams.polling.urlstring >tm.dataServer.polling.urlstring >health.timepadint >tm.polling.intervalint >health.threadPoolint >health.polling.intervalint >health.event-countint >tm.crConfig.polling.urlnumber >CDN_namenumber trafficMonitorsarray A collection of Traffic Monitors. >profilestring >locationstring >ipstring >statusstring >ip6string >portint >hostNamestring >fqdnstring deliveryServicesarray A collection of delivery services. >xmlIdstring >totalTpsThresholdint >statusstring >totalKbpsThresholdint profilesarray A collection of profiles. >parametershash >>health.connection.timeoutint >>health.polling.urlstring >>health.threshold.queryTimeint >>history.countint >>health.threshold.availableBandwidthInKbpsstring >>health.threshold.loadavgstring >namestring >typestring Response Example
TBD
GET /api/1.2/cdns/:name/configs/routing
Retrieves CDN routing information.
Authentication Required: Yes
Role(s) Required: None
Request Route Parameters
Name Required Description nameyes Response Properties
Parameter Type Description trafficServersarray A collection of Traffic Servers. >profilestring >ipstring >statusstring >cacheGroupstring >ip6string >portint >deliveryServicesarray >>xmlIdstring >>remapsarray >>hostNamestring >fqdnstring >interfaceNamestring >typestring >hashIdstring statshash >trafficOpsPathstring >cdnNamestring >trafficOpsVersionstring >trafficOpsUserstring >dateint >trafficOpsHoststring cacheGroupsarray A collection of cache groups. >coordinateshash >>longitudenumber >>latitudenumber >namestring confighash >tld.soa.adminstring >tcoveragezone.polling.intervalint >geolocation.polling.intervalint >tld.soa.expireint >coveragezone.polling.urlstring >tld.soa.minimumint >geolocation.polling.urlstring >domain_namestring >tld.ttls.AAAAint >tld.soa.refreshint >tld.ttls.NSint >tld.ttls.SOAint >geolocation6.polling.intervalint >tld.ttls.Aint >tld.soa.retryint >geolocation6.polling.urlstring trafficMonitorsarray A collection of Traffic Monitors. >profilestring >locationstring >ipstring >statusstring >ip6string >portint >hostNamestring >fqdnstring deliveryServicesarray A collection of delivery services. >xmlIdstring >ttlint >geoEnabledstring >coverageZoneOnlyboolean >matchSetsarray >>protocolstring >>matchListarray >>>regexstring >>>matchTypestring >bypassDestinationhash >>maxDnsIpsForLocationint >>ttlint >>typestring >ttlshash >>Aint >>SOAint >>NSint >>AAAAint >missCoordinateshash >>longitudenumber >>latitudenumber >soahash >>adminstring >>retryint >>minimumint >>refreshint >>expireint trafficRoutershash >profileint >locationstring >ipstring >statusstring >ip6string >portint >hostNamestring >fqdnstring >apiPortint
Response Example
TBD
DNSSEC Keys¶
GET /api/1.2/cdns/name/:name/dnsseckeys
Gets a list of dnsseckeys for a CDN and all associated Delivery Services.
Authentication Required: Yes
Role(s) Required: Admin
Request Route Parameters
Name Required Description nameyes Response Properties
Parameter Type Description cdn name/ds xml_idstring identifier for ds or cdn >zsk/kskarray collection of zsk/ksk data >>ttlstring time-to-live for dnssec requests >>inceptionDatestring epoch timestamp for when the keys were created >>expirationDatestring epoch timestamp representing the expiration of the keys >>privatestring encoded private key >>publicstring encoded public key >>namestring domain name versionstring API version ksk>>dsRecord>>algorithmstring The algorithm of the referenced DNSKEY-recor. ksk>>dsRecord>>digestTypestring Cryptographic hash algorithm used to create the Digest value. ksk>>dsRecord>>digeststring A cryptographic hash value of the referenced DNSKEY-record. Response Example
{ "response": { "cdn1": { "zsk": { "ttl": "60", "inceptionDate": "1426196750", "private": "zsk private key", "public": "zsk public key", "expirationDate": "1428788750", "name": "foo.kabletown.com." }, "ksk": { "name": "foo.kabletown.com.", "expirationDate": "1457732750", "public": "ksk public key", "private": "ksk private key", "inceptionDate": "1426196750", "ttl": "60", dsRecord: { "algorithm": "5", "digestType": "2", "digest": "abc123def456" } } }, "ds-01": { "zsk": { "ttl": "60", "inceptionDate": "1426196750", "private": "zsk private key", "public": "zsk public key", "expirationDate": "1428788750", "name": "ds-01.foo.kabletown.com." }, "ksk": { "name": "ds-01.foo.kabletown.com.", "expirationDate": "1457732750", "public": "ksk public key", "private": "ksk private key", "inceptionDate": "1426196750" } }, ... repeated for each ds in the cdn }, }
GET /api/1.2/cdns/name/:name/dnsseckeys/delete
Delete dnssec keys for a cdn and all associated delivery services.
Authentication Required: Yes
Role(s) Required: Admin
Request Route Parameters
Name Required Description nameyes name of the CDN for which you want to delete dnssec keys Response Properties
Parameter Type Description responsestring success response Response Example
{ "response": "Successfully deleted dnssec keys for <cdn>" }
POST /api/1.2/deliveryservices/dnsseckeys/generate
Generates ZSK and KSK keypairs for a CDN and all associated Delivery Services.
Authentication Required: Yes
Role(s) Required: Admin
Request Properties
Parameter Type Description keystring name of the cdn namestring domain name of the cdn ttlstring time to live kskExpirationDaysstring Expiration (in days) for the key signing keys zskExpirationDaysstring Expiration (in days) for the zone signing keys Request Example
{ "key": "cdn1", "name" "ott.kabletown.com", "ttl": "60", "kskExpirationDays": "365", "zskExpirationDays": "90" }Response Properties
Parameter Type Description responsestring response string versionstring API version Response Example
{ "response": "Successfully created dnssec keys for cdn1" }
SSL Keys¶
GET /api/1.2/cdns/name/:name/sslkeys
Returns ssl certificates for all Delivery Services that are a part of the CDN.
Authentication Required: Yes
Role(s) Required: Admin
Request Route Parameters
Name Required Description nameyes Response Properties
Parameter Type Description deliveryservicestring identifier for deliveryservice xml_id certificatearray collection of certificate >>keystring base64 encoded private key for ssl certificate >>crtstring base64 encoded ssl certificate Response Example
{ "response": [ { "deliveryservice": "ds1", "certificate": { "crt": "base64encodedcrt1", "key": "base64encodedkey1" } }, { "deliveryservice": "ds2", "certificate": { "crt": "base64encodedcrt2", "key": "base64encodedkey2" } } ] }