Skip to content

Instantly share code, notes, and snippets.

@fno2010
Last active January 4, 2022 15:59
Show Gist options
  • Save fno2010/9d4ac11ff268a83011f7d0bcf5bd44e2 to your computer and use it in GitHub Desktop.
Save fno2010/9d4ac11ff268a83011f7d0bcf5bd44e2 to your computer and use it in GitHub Desktop.
Check JSON Content Length for Cost-Calendar Document
#!/bin/bash
for i in $(find -name '*.json'); do
echo $i
curl --http1.1 --data-binary @$i \
-v -H 'Content-Type: application/json' \
example.com 2>&1 -o /dev/null | grep -Fi '> Content-Length'
done
{
"cost-type" : {"cost-mode" : "numerical",
"cost-metric" : "routingcost"},
"calendared" : [true],
"endpoints" : {
"srcs": [ "ipv4:192.0.2.2" ],
"dsts": [
"ipv4:192.0.2.89",
"ipv4:198.51.100.34",
"ipv4:203.0.113.45",
"ipv6:2001:db8::10"
]
}
}
{
"meta" : {
"cost-type" : {"cost-mode" : "numerical",
"cost-metric" : "routingcost"},
"calendar-response-attributes" : [
{"calendar-start-time" : "Mon, 30 Jun 2014 00:00:00 GMT",
"time-interval-size" : 3600,
"number-of-intervals" : 24,
"repeated": 4
}
]
},
"endpoint-cost-map" : {
"ipv4:192.0.2.2": {
"ipv4:192.0.2.89" : [v1, v2, ... v24],
"ipv4:198.51.100.34" : [v1, v2, ... v24],
"ipv4:203.0.113.45" : [v1, v2, ... v24],
"ipv6:2001:db8::10" : [v1, v2, ... v24]
}
}
}
{
"cost-type" : {"cost-mode" : "numerical",
"cost-metric" : "throughputrating"},
"calendared" : [true],
"pids" : {
"srcs" : [ "PID1", "PID2" ],
"dsts" : [ "PID1", "PID2", "PID3" ]
}
}
{
"meta" : {
"dependent-vtags" : [
{"resource-id": "my-default-network-map",
"tag": "3ee2cb7e8d63d9fab71b9b34cbf764436315542e"
}
],
"cost-type" : {"cost-mode" : "numerical",
"cost-metric" : "throughputrating"},
"calendar-response-attributes" : [
{"calendar-start-time" : "Tue, 1 Jul 2014 13:00:00 GMT",
"time-interval-size" : 7200,
"number-of-intervals" : 12}
]
},
"cost-map" : {
"PID1": { "PID1": [v1,v2, ... v12],
"PID2": [v1,v2, ... v12],
"PID3": [v1,v2, ... v12] },
"PID2": { "PID1": [v1,v2, ... v12],
"PID2": [v1,v2, ... v12],
"PID3": [v1,v2, ... v12] }
}
}
{
"meta" : {
"default-alto-network-map" : "my-default-network-map",
"cost-types": {
"num-routingcost": {
"cost-mode" : "numerical",
"cost-metric" : "routingcost"
},
"num-owdelay": {
"cost-mode" : "numerical",
"cost-metric": "owdelay"
},
"num-throughputrating": {
"cost-mode" : "numerical",
"cost-metric": "throughputrating"
},
"string-servicestatus": {
"cost-mode" : "string",
"cost-metric": "servicestatus"
}
}
},
"resources" : {
"filtered-cost-map-calendar" : {
"uri" :
"https://custom.alto.example.com/calendar/costmap/filtered",
"media-type" : "application/alto-costmap+json",
"accepts" : "application/alto-costmapfilter+json",
"capabilities" : {
"cost-constraints" : true,
"cost-type-names" : [ "num-routingcost",
"num-throughputrating",
"string-servicestatus" ],
"calendar-attributes" : [
{"cost-type-names" : [ "num-routingcost",
"num-throughputrating" ],
"time-interval-size" : 7200,
"number-of-intervals" : 24
},
{"cost-type-names" : [ "string-servicestatus" ],
"time-interval-size" : 1800,
"number-of-intervals" : 48
}
]
},
"uses": [ "my-default-network-map" ]
},
"endpoint-cost-calendar-map" : {
"uri" :
"https://custom.alto.example.com/calendar/endpointcost/lookup",
"media-type" : "application/alto-endpointcost+json",
"accepts" : "application/alto-endpointcostparams+json",
"capabilities" : {
"cost-constraints" : true,
"cost-type-names" : [ "num-routingcost",
"num-owdelay",
"num-throughputrating",
"string-servicestatus" ],
"calendar-attributes" : [
{"cost-type-names" : [ "num-routingcost" ],
"time-interval-size" : 3600,
"number-of-intervals" : 24
},
{"cost-type-names" : [ "num-owdelay" ],
"time-interval-size" : 300,
"number-of-intervals" : 12
},
{"cost-type-names" : [ "num-throughputrating" ],
"time-interval-size" : 60,
"number-of-intervals" : 60
},
{"cost-type-names" : [ "string-servicestatus" ],
"time-interval-size" : 120,
"number-of-intervals" : 30
}
]
}
}
}
}
{
"cost-type" : {},
"multi-cost-types" : [
{"cost-mode" : "numerical", "cost-metric" : "routingcost"},
{"cost-mode" : "numerical", "cost-metric" : "owdelay"}
],
"calendared" : [true, true],
"endpoints" : {
"srcs": [ "ipv4:192.0.2.2" ],
"dsts": [
"ipv4:192.0.2.89",
"ipv4:198.51.100.34",
"ipv4:203.0.113.45",
"ipv6:2001:db8::10"
]
}
}
{
"meta" : {
"multi-cost-types" : [
{"cost-mode" : "numerical", "cost-metric" : "routingcost"},
{"cost-mode" : "numerical", "cost-metric" : "owdelay"}
],
"calendar-response-attributes" : [
{"cost-type-names" : "num-routingcost",
"calendar-start-time" : "Mon, 30 Jun 2014 00:00:00 GMT",
"time-interval-size" : 3600,
"number-of-intervals" : 24,
"repeated": 4 },
{"cost-type-names" : "num-owdelay",
"calendar-start-time" : "Tue, 1 Jul 2014 13:00:00 GMT",
"time-interval-size" : 300,
"number-of-intervals" : 12}
]
},
"endpoint-cost-map" : {
"ipv4:192.0.2.2": {
"ipv4:192.0.2.89" : [[r1, r2, ... r24], [o1, o2, ... o12]],
"ipv4:198.51.100.34" : [[r1, r2, ... r24], [o1, o2, ... o12]],
"ipv4:203.0.113.45" : [[r1, r2, ... r24], [o1, o2, ... o12]],
"ipv6:2001:db8::10" : [[r1, r2, ... r24],
[o1, o2, ... o12]]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment