// do we have such element + is it a modal? --> show it
if (element.length&&element.hasClass('modal')){
element.modal('show');
}
});
// execute hashchange on first page load
$(window).trigger('hashchange');
// remove url fragment on modal hide
$('.modal').on('hidden.bs.modal',function(){
try{
if (history&&history.replaceState){
history.replaceState({},'','#');
}
}catch(e){}
});
});
</script><style>
.hljs{
background:transparent;
}
.parent{
color:#999;
}
.list-group-item>.badge{
float:none;
margin-right:6px;
}
.panel-title>.methods{
float:right;
}
.badge{
border-radius:0;
text-transform:uppercase;
width:70px;
font-weight:normal;
color:#f3f3f6;
line-height:normal;
}
.badge_get{
background-color:#63a8e2;
}
.badge_post{
background-color:#6cbd7d;
}
.badge_put{
background-color:#22bac4;
}
.badge_delete{
background-color:#d26460;
}
.badge_patch{
background-color:#ccc444;
}
.list-group,.panel-group{
margin-bottom:0;
}
.panel-group.panel+.panel-white{
margin-top:0;
}
.panel-group.panel-white{
border-bottom:1pxsolid#F5F5F5;
border-radius:0;
}
.panel-white:last-child{
border-bottom-color:white;
-webkit-box-shadow:none;
box-shadow:none;
}
.panel-white.panel-heading{
background:white;
}
.tab-paneul{
padding-left:2em;
}
.tab-paneh1{
font-size:1.3em;
}
.tab-paneh2{
font-size:1.2em;
padding-bottom:4px;
border-bottom:1pxsolid#ddd;
}
.tab-paneh3{
font-size:1.1em;
}
.tab-content{
border-left:1pxsolid#ddd;
border-right:1pxsolid#ddd;
border-bottom:1pxsolid#ddd;
padding:10px;
}
#sidebar{
margin-top:30px;
padding-right:5px;
overflow:auto;
height:90%;
}
.top-resource-description{
border-bottom:1pxsolid#ddd;
background:#fcfcfc;
padding:15px15px015px;
margin:-15px-15px10px-15px;
}
.resource-description{
border-bottom:1pxsolid#fcfcfc;
background:#fcfcfc;
padding:15px15px015px;
margin:-15px-15px10px-15px;
}
.resource-descriptionp:last-child{
margin:0;
}
.list-group.badge{
float:left;
}
.method_description{
margin-left:85px;
}
.method_descriptionp:last-child{
margin:0;
}
.list-group-item{
cursor:pointer;
}
.list-group-item:hover{
background-color:#f5f5f5;
}
precode{
overflow:auto;
word-wrap:normal;
white-space:pre;
}
</style></head><bodydata-spy="scroll"data-target="#sidebar"><divclass="container"><divclass="row"><divclass="col-md-9"role="main"><divclass="page-header"><h1>BlenDB API API documentation <small>version v1</small></h1><p>http://blendb.c3sl.ufpr.br/api/v1</p></div><divclass="panel panel-default"><divclass="panel-heading"><h3id="metrics"class="panel-title">/metrics</h3></div><divclass="panel-body"><divclass="top-resource-description"><p>A Metric represents a statistic that can be queried to generate reports. This collection allows the user to list all the metrics available in the system and their descriptions.</p></div><divclass="panel-group"><divclass="panel panel-white"><divclass="panel-heading"><h4class="panel-title"><aclass="collapsed"data-toggle="collapse"href="#panel_metrics"><spanclass="parent"></span>/metrics</a><spanclass="methods"><ahref="#metrics_get"><spanclass="badge badge_get">get <spanclass="glyphicon glyphicon-lock"title="Authentication required"></span></span></a></span></h4></div><divid="panel_metrics"class="panel-collapse collapse"><divclass="panel-body"><divclass="list-group"><divonclick="window.location.href = '#metrics_get'"class="list-group-item"><spanclass="badge badge_get">get <spanclass="glyphicon glyphicon-lock"title="Authentication required"></span></span><divclass="method_description"></div><divclass="clearfix"></div></div></div></div></div><divclass="modal fade"tabindex="0"id="metrics_get"><divclass="modal-dialog"><divclass="modal-content"><divclass="modal-header"><buttontype="button"class="close"data-dismiss="modal"aria-hidden="true">×</button><h4class="modal-title"id="myModalLabel"><spanclass="badge badge_get">get <spanclass="glyphicon glyphicon-lock"title="Authentication required"></span></span><spanclass="parent"></span>/metrics</h4></div><divclass="modal-body"><divclass="alert alert-warning"><spanclass="glyphicon glyphicon-lock"title="Authentication required"></span> Secured by <b>oauth_2_0</b><p>OAuth2 is a protocol that lets apps request authorization to private details in the system while avoiding the use of passwords. This is preferred over Basic Authentication because tokens can be limited to specific types of data, and can be revoked by users at any time.</p></div><ulclass="nav nav-tabs"><li><ahref="#metrics_get_securedby"data-toggle="tab">Security</a></li></ul><divclass="tab-content"><divclass="tab-pane"id="metrics_get_securedby"><h1>Secured by</h1><h1>Secured by oauth_2_0</h1><h3>Headers</h3><ul><li><strong>Authorization</strong>: <em>(string)</em><p>Used to send a valid OAuth 2 access token. Do not use together with the "access_token" query string parameter.</p></li></ul><h2>HTTP status code <ahref="http://httpstatus.es/401"target="_blank">401</a></h2><p>Bad or expired token. This can happen if access token has expired or has been revoked by the user.</p><h2>HTTP status code <ahref="http://httpstatus.es/403"target="_blank">403</a></h2><p>Bad OAuth2 request (wrong consumer key, bad nonce, expired timestamp, ...).</p></div></div></div></div></div></div></div></div></div></div><divclass="panel panel-default"><divclass="panel-heading"><h3id="dimensions"class="panel-title">/dimensions</h3></div><divclass="panel-body"><divclass="top-resource-description"><p>A Dimension allows the data to be aggregated by one or more columns. This collection allows the user to list all the dimensions available in the system and their descriptions.</p></div><divclass="panel-group"><divclass="panel panel-white"><divclass="panel-heading"><h4class="panel-title"><aclass="collapsed"data-toggle="collapse"href="#panel_dimensions"><spanclass="parent"></span>/dimensions</a><spanclass="methods"><ahref="#dimensions_get"><spanclass="badge badge_get">get <spanclass="glyphicon glyphicon-lock"title="Authentication required"></span></span></a></span></h4></div><divid="panel_dimensions"class="panel-collapse collapse"><divclass="panel-body"><divclass="list-group"><divonclick="window.location.href = '#dimensions_get'"class="list-group-item"><spanclass="badge badge_get">get <spanclass="glyphicon glyphicon-lock"title="Authentication required"></span></span><divclass="method_description"></div><divclass="clearfix"></div></div></div></div></div><divclass="modal fade"tabindex="0"id="dimensions_get"><divclass="modal-dialog"><divclass="modal-content"><divclass="modal-header"><buttontype="button"class="close"data-dismiss="modal"aria-hidden="true">×</button><h4class="modal-title"id="myModalLabel"><spanclass="badge badge_get">get <spanclass="glyphicon glyphicon-lock"title="Authentication required"></span></span><spanclass="parent"></span>/dimensions</h4></div><divclass="modal-body"><divclass="alert alert-warning"><spanclass="glyphicon glyphicon-lock"title="Authentication required"></span> Secured by <b>oauth_2_0</b><p>OAuth2 is a protocol that lets apps request authorization to private details in the system while avoiding the use of passwords. This is preferred over Basic Authentication because tokens can be limited to specific types of data, and can be revoked by users at any time.</p></div><ulclass="nav nav-tabs"><li><ahref="#dimensions_get_securedby"data-toggle="tab">Security</a></li></ul><divclass="tab-content"><divclass="tab-pane"id="dimensions_get_securedby"><h1>Secured by</h1><h1>Secured by oauth_2_0</h1><h3>Headers</h3><ul><li><strong>Authorization</strong>: <em>(string)</em><p>Used to send a valid OAuth 2 access token. Do not use together with the "access_token" query string parameter.</p></li></ul><h2>HTTP status code <ahref="http://httpstatus.es/401"target="_blank">401</a></h2><p>Bad or expired token. This can happen if access token has expired or has been revoked by the user.</p><h2>HTTP status code <ahref="http://httpstatus.es/403"target="_blank">403</a></h2><p>Bad OAuth2 request (wrong consumer key, bad nonce, expired timestamp, ...).</p></div></div></div></div></div></div></div></div></div></div><divclass="panel panel-default"><divclass="panel-heading"><h3id="data"class="panel-title">/data</h3></div><divclass="panel-body"><divclass="top-resource-description"><p>This is the main part of the API. You may query it for report data by specifying metrics (at least one). You may also supply additional query parameters such as dimensions, filters, and start/end dates to refine your query.</p></div><divclass="panel-group"><divclass="panel panel-white"><divclass="panel-heading"><h4class="panel-title"><aclass="collapsed"data-toggle="collapse"href="#panel_data"><spanclass="parent"></span>/data</a><spanclass="methods"><ahref="#data_get"><spanclass="badge badge_get">get</span></a></span></h4></div><divid="panel_data"class="panel-collapse collapse"><divclass="panel-body"><divclass="list-group"><divonclick="window.location.href = '#data_get'"class="list-group-item"><spanclass="badge badge_get">get</span><divclass="method_description"></div><divclass="clearfix"></div></div></div></div></div><divclass="modal fade"tabindex="0"id="data_get"><divclass="modal-dialog"><divclass="modal-content"><divclass="modal-header"><buttontype="button"class="close"data-dismiss="modal"aria-hidden="true">×</button><h4class="modal-title"id="myModalLabel"><spanclass="badge badge_get">get</span><spanclass="parent"></span>/data</h4></div><divclass="modal-body"><ulclass="nav nav-tabs"><liclass="active"><ahref="#data_get_request"data-toggle="tab">Request</a></li><li><ahref="#data_get_response"data-toggle="tab">Response</a></li></ul><divclass="tab-content"><divclass="tab-pane active"id="data_get_request"><h3>Query Parameters</h3><ul><li><strong>filters</strong>: <em>(string)</em><p>Filters that restrict the data returned for your request.</p><p><strong>Example</strong>:</p><pre>dim:location(4).id%3D%3D10723</pre></li><li><strong>metrics</strong>: <em>required (string)</em><p>A list of comma-separated metrics.</p><p><strong>Example</strong>:</p><pre>met:daysSinceLastContact,met:estimatedNetworkBandwidth</pre></li><li><strong>dimensions</strong>: <em>required (string)</em><p>A list of comma-separated dimensions.</p><p><strong>Example</strong>:</p><pre>dim:project,dim:point</pre></li><li><strong>start-date</strong>: <em>(string - pattern: [0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo))</em><p>Start date for fetching data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or NdaysAgo where N is a positive integer).</p><p><strong>Example</strong>:</p><pre>7daysAgo</pre></li><li><strong>end-date</strong>: <em>(string - pattern: [0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo))</em><p>End date for fetching data. Requests can specify a end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or NdaysAgo where N is a positive integer).</p><p><strong>Example</strong>:</p><pre>yesterday</pre></li><li><strong>sort</strong>: <em>(string)</em><p>A list of comma-separated dimensions and metrics indicating the sorting order and sorting direction for the returned data.</p><p><strong>Example</strong>:</p><pre>dim:project</pre></li></ul></div><divclass="tab-pane"id="data_get_response"><h2>HTTP status code <ahref="http://httpstatus.es/200"target="_blank">200</a></h2><p>Query successfully executed. Data is returned in a table format.</p><h3>Body</h3><p><strong>Type: application/json</strong></p><h2>HTTP status code <ahref="http://httpstatus.es/400"target="_blank">400</a></h2><p>The supplied query is invalid. Specified metric or dimension doesn't exist, incorrect formatting for a filter, unacceptable date range, etc.</p><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
"id": "metric_not_found",
"message": "The specified metric 'met:electricCharge' could not be found."
</code></pre></div></div></div></div></div></div></div></div></div></div><divclass="panel panel-default"><divclass="panel-heading"><h3id="collect__sourceName_"class="panel-title">/collect/{sourceName}</h3></div><divclass="panel-body"><divclass="top-resource-description"><p>This API may be used to send data to the monitoring system. All data sent must be identified with a sourceName, i.e. "gesacNetworkBandwidth".</p></div><divclass="panel-group"><divclass="panel panel-white"><divclass="panel-heading"><h4class="panel-title"><aclass="collapsed"data-toggle="collapse"href="#panel_collect__sourceName_"><spanclass="parent"></span>/collect/{sourceName}</a><spanclass="methods"><ahref="#collect__sourceName__post"><spanclass="badge badge_post">post</span></a></span></h4></div><divid="panel_collect__sourceName_"class="panel-collapse collapse"><divclass="panel-body"><divclass="list-group"><divonclick="window.location.href = '#collect__sourceName__post'"class="list-group-item"><spanclass="badge badge_post">post</span><divclass="method_description"></div><divclass="clearfix"></div></div></div></div></div><divclass="modal fade"tabindex="0"id="collect__sourceName__post"><divclass="modal-dialog"><divclass="modal-content"><divclass="modal-header"><buttontype="button"class="close"data-dismiss="modal"aria-hidden="true">×</button><h4class="modal-title"id="myModalLabel"><spanclass="badge badge_post">post</span><spanclass="parent"></span>/collect/{sourceName}</h4></div><divclass="modal-body"><ulclass="nav nav-tabs"><liclass="active"><ahref="#collect__sourceName__post_request"data-toggle="tab">Request</a></li><li><ahref="#collect__sourceName__post_response"data-toggle="tab">Response</a></li></ul><divclass="tab-content"><divclass="tab-pane active"id="collect__sourceName__post_request"><h3>URI Parameters</h3><ul><li><strong>sourceName</strong>: <em>required (string - minLength: 4 - maxLength: 64 - pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$)</em><p>An identifying name for the data that is being collected.</p></li></ul><h3>Body</h3><p><strong>Type: application/json</strong></p></div><divclass="tab-pane"id="collect__sourceName__post_response"><h2>HTTP status code <ahref="http://httpstatus.es/200"target="_blank">200</a></h2><p>Data has been successfully received and stored by the server.</p><h2>HTTP status code <ahref="http://httpstatus.es/400"target="_blank">400</a></h2><p>An error has been found in your request. You may review your request and the data that is being sent and try again later.</p><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
"id": "type_error",
"message": "Invalid type for attribute \"memory\"."