1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-21 23:55:13 -05:00

Web API: replaced status code 200 by 202 whenever an asynchronous message is enqueued

This commit is contained in:
f4exb 2017-12-21 18:10:43 +01:00
parent 88e56d1a37
commit 41e18eefd2
16 changed files with 236 additions and 235 deletions

View File

@ -2469,22 +2469,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return informative message </h3>
<h3> Status: 202 - Message to add a channel was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-devicesetChannelPost-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-devicesetChannelPost-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-devicesetChannelPost-200-schema">
<div id='responses-devicesetChannelPost-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-devicesetChannelPost-202-schema">
<div id='responses-devicesetChannelPost-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return informative message",
"description" : "Message to add a channel was sent successfully",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
@ -2501,14 +2501,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-devicesetChannelPost-200-schema-data').val(stringify(schema));
var result = $('#responses-devicesetChannelPost-200-schema-200');
$('#responses-devicesetChannelPost-202-schema-data').val(stringify(schema));
var result = $('#responses-devicesetChannelPost-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-devicesetChannelPost-200-schema-data' type='hidden' value=''></input>
<input id='responses-devicesetChannelPost-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -4324,22 +4324,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return details on the selected device </h3>
<h3> Status: 202 - On successful semdomg of the message it returns the details of the device being set </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-devicesetDevicePut-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-devicesetDevicePut-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-devicesetDevicePut-200-schema">
<div id='responses-devicesetDevicePut-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-devicesetDevicePut-202-schema">
<div id='responses-devicesetDevicePut-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return details on the selected device",
"description" : "On successful semdomg of the message it returns the details of the device being set",
"schema" : {
"$ref" : "#/definitions/DeviceListItem"
}
@ -4356,14 +4356,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-devicesetDevicePut-200-schema-data').val(stringify(schema));
var result = $('#responses-devicesetDevicePut-200-schema-200');
$('#responses-devicesetDevicePut-202-schema-data').val(stringify(schema));
var result = $('#responses-devicesetDevicePut-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-devicesetDevicePut-200-schema-data' type='hidden' value=''></input>
<input id='responses-devicesetDevicePut-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -8955,22 +8955,22 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success returns instance summary before it was closed </h3>
<h3> Status: 202 - Message to stop the SDRangel instance was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceDelete-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceDelete-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceDelete-200-schema">
<div id='responses-instanceDelete-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instanceDelete-202-schema">
<div id='responses-instanceDelete-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success returns instance summary before it was closed",
"description" : "Message to stop the SDRangel instance was sent successfully",
"schema" : {
"$ref" : "#/definitions/InstanceSummaryResponse"
}
@ -8987,14 +8987,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceDelete-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceDelete-200-schema-200');
$('#responses-instanceDelete-202-schema-data').val(stringify(schema));
var result = $('#responses-instanceDelete-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceDelete-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceDelete-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -9255,22 +9255,22 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success return informative message </h3>
<h3> Status: 202 - Message to remove last device set was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceDeviceSetsDelete-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceDeviceSetsDelete-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceDeviceSetsDelete-200-schema">
<div id='responses-instanceDeviceSetsDelete-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instanceDeviceSetsDelete-202-schema">
<div id='responses-instanceDeviceSetsDelete-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return informative message",
"description" : "Message to remove last device set was sent successfully",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
@ -9287,14 +9287,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceDeviceSetsDelete-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsDelete-200-schema-200');
$('#responses-instanceDeviceSetsDelete-202-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsDelete-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceDeviceSetsDelete-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceDeviceSetsDelete-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -9936,22 +9936,22 @@ except ApiException as e:
</table>
<h2>Responses</h2>
<h3> Status: 200 - On success return informative messsage </h3>
<h3> Status: 202 - Message to add a new device set was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceDeviceSetsPost-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceDeviceSetsPost-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceDeviceSetsPost-200-schema">
<div id='responses-instanceDeviceSetsPost-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instanceDeviceSetsPost-202-schema">
<div id='responses-instanceDeviceSetsPost-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return informative messsage",
"description" : "Message to add a new device set was sent successfully",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
@ -9968,14 +9968,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceDeviceSetsPost-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsPost-200-schema-200');
$('#responses-instanceDeviceSetsPost-202-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsPost-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceDeviceSetsPost-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceDeviceSetsPost-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -11981,22 +11981,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return deleted preset identification </h3>
<h3> Status: 202 - On successful sending of the message the selected preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetDelete-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetDelete-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetDelete-200-schema">
<div id='responses-instancePresetDelete-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetDelete-202-schema">
<div id='responses-instancePresetDelete-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return deleted preset identification",
"description" : "On successful sending of the message the selected preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -12013,14 +12013,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetDelete-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetDelete-200-schema-200');
$('#responses-instancePresetDelete-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetDelete-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetDelete-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetDelete-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -13595,22 +13595,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return preset identification </h3>
<h3> Status: 202 - On successful sending of the message the selected preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetPatch-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetPatch-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetPatch-200-schema">
<div id='responses-instancePresetPatch-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetPatch-202-schema">
<div id='responses-instancePresetPatch-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return preset identification",
"description" : "On successful sending of the message the selected preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -13627,14 +13627,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetPatch-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPatch-200-schema-200');
$('#responses-instancePresetPatch-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPatch-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetPatch-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetPatch-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -14033,22 +14033,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return preset identification </h3>
<h3> Status: 202 - On successful sending of the message the created preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetPost-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetPost-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetPost-200-schema">
<div id='responses-instancePresetPost-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetPost-202-schema">
<div id='responses-instancePresetPost-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return preset identification",
"description" : "On successful sending of the message the created preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -14065,14 +14065,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetPost-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPost-200-schema-200');
$('#responses-instancePresetPost-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPost-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetPost-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetPost-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -14514,22 +14514,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return preset identification </h3>
<h3> Status: 202 - On successful sending of the message the selected preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetPut-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetPut-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetPut-200-schema">
<div id='responses-instancePresetPut-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetPut-202-schema">
<div id='responses-instancePresetPut-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return preset identification",
"description" : "On successful sending of the message the selected preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -14546,14 +14546,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetPut-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPut-200-schema-200');
$('#responses-instancePresetPut-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPut-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetPut-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetPut-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -15011,7 +15011,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2017-12-21T00:41:40.926+01:00
Generated 2017-12-21T15:48:45.512+01:00
</div>
</div>
</div>

View File

@ -71,7 +71,7 @@ public:
* returns the Http status code (default 501: not implemented)
*/
virtual int instanceDelete(
SWGSDRangel::SWGInstanceSummaryResponse& response __attribute__((unused)),
SWGSDRangel::SWGSuccessResponse& response __attribute__((unused)),
SWGSDRangel::SWGErrorResponse& error)
{
error.init();

View File

@ -139,7 +139,7 @@ void WebAPIRequestMapper::instanceSummaryService(qtwebapp::HttpRequest& request,
int status = m_adapter->instanceSummary(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -147,12 +147,12 @@ void WebAPIRequestMapper::instanceSummaryService(qtwebapp::HttpRequest& request,
}
else if (request.getMethod() == "DELETE")
{
SWGSDRangel::SWGInstanceSummaryResponse normalResponse;
SWGSDRangel::SWGSuccessResponse normalResponse;
int status = m_adapter->instanceDelete(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -185,7 +185,7 @@ void WebAPIRequestMapper::instanceDevicesService(qtwebapp::HttpRequest& request,
int status = m_adapter->instanceDevices(tx, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -218,7 +218,7 @@ void WebAPIRequestMapper::instanceChannelsService(qtwebapp::HttpRequest& request
int status = m_adapter->instanceChannels(tx, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -244,7 +244,7 @@ void WebAPIRequestMapper::instanceLoggingService(qtwebapp::HttpRequest& request,
int status = m_adapter->instanceLoggingGet(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -261,7 +261,7 @@ void WebAPIRequestMapper::instanceLoggingService(qtwebapp::HttpRequest& request,
int status = m_adapter->instanceLoggingPut(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -296,7 +296,7 @@ void WebAPIRequestMapper::instanceAudioService(qtwebapp::HttpRequest& request, q
int status = m_adapter->instanceAudioGet(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -314,7 +314,7 @@ void WebAPIRequestMapper::instanceAudioService(qtwebapp::HttpRequest& request, q
int status = m_adapter->instanceAudioPatch(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -349,7 +349,7 @@ void WebAPIRequestMapper::instanceLocationService(qtwebapp::HttpRequest& request
int status = m_adapter->instanceLocationGet(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -367,7 +367,7 @@ void WebAPIRequestMapper::instanceLocationService(qtwebapp::HttpRequest& request
int status = m_adapter->instanceLocationPut(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -409,7 +409,7 @@ void WebAPIRequestMapper::instanceDVSerialService(qtwebapp::HttpRequest& request
int status = m_adapter->instanceDVSerialPatch(dvserial, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -435,7 +435,7 @@ void WebAPIRequestMapper::instancePresetsService(qtwebapp::HttpRequest& request,
int status = m_adapter->instancePresetsGet(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -464,7 +464,7 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
int status = m_adapter->instancePresetPatch(query, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -502,7 +502,7 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
int status = m_adapter->instancePresetPut(query, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -540,7 +540,7 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
int status = m_adapter->instancePresetPost(query, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -577,7 +577,7 @@ void WebAPIRequestMapper::instancePresetService(qtwebapp::HttpRequest& request,
int status = m_adapter->instancePresetDelete(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -629,7 +629,7 @@ void WebAPIRequestMapper::instancePresetFileService(qtwebapp::HttpRequest& reque
int status = m_adapter->instancePresetFilePut(query, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -667,7 +667,7 @@ void WebAPIRequestMapper::instancePresetFileService(qtwebapp::HttpRequest& reque
int status = m_adapter->instancePresetFilePost(query, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -709,7 +709,7 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque
int status = m_adapter->instanceDeviceSetsGet(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -728,7 +728,7 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque
int status = m_adapter->instanceDeviceSetsPost(tx, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -740,7 +740,7 @@ void WebAPIRequestMapper::instanceDeviceSetsService(qtwebapp::HttpRequest& reque
int status = m_adapter->instanceDeviceSetsDelete(normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -769,7 +769,7 @@ void WebAPIRequestMapper::devicesetService(const std::string& indexStr, qtwebapp
int status = m_adapter->devicesetGet(deviceSetIndex, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -814,7 +814,7 @@ void WebAPIRequestMapper::devicesetDeviceService(const std::string& indexStr, qt
int status = m_adapter->devicesetDevicePut(deviceSetIndex, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -873,7 +873,7 @@ void WebAPIRequestMapper::devicesetDeviceSettingsService(const std::string& inde
errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -902,7 +902,7 @@ void WebAPIRequestMapper::devicesetDeviceSettingsService(const std::string& inde
int status = m_adapter->devicesetDeviceSettingsGet(deviceSetIndex, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -941,7 +941,7 @@ void WebAPIRequestMapper::devicesetDeviceRunService(const std::string& indexStr,
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -954,7 +954,7 @@ void WebAPIRequestMapper::devicesetDeviceRunService(const std::string& indexStr,
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -967,7 +967,7 @@ void WebAPIRequestMapper::devicesetDeviceRunService(const std::string& indexStr,
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -1027,7 +1027,7 @@ void WebAPIRequestMapper::devicesetChannelService(
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -1088,7 +1088,7 @@ void WebAPIRequestMapper::devicesetChannelIndexService(
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -1132,7 +1132,7 @@ void WebAPIRequestMapper::devicesetChannelSettingsService(
int status = m_adapter->devicesetChannelSettingsGet(deviceSetIndex, channelIndex, normalResponse, errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());
@ -1158,7 +1158,7 @@ void WebAPIRequestMapper::devicesetChannelSettingsService(
errorResponse);
response.setStatus(status);
if (status == 200) {
if (status/100 == 2) {
response.write(normalResponse.asJson().toUtf8());
} else {
response.write(errorResponse.asJson().toUtf8());

View File

@ -421,7 +421,7 @@ int WebAPIAdapterGUI::instancePresetPatch(
*response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
*response.getName() = selectedPreset->getDescription();
return 200;
return 202;
}
int WebAPIAdapterGUI::instancePresetPut(
@ -477,7 +477,7 @@ int WebAPIAdapterGUI::instancePresetPut(
*response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
*response.getName() = selectedPreset->getDescription();
return 200;
return 202;
}
int WebAPIAdapterGUI::instancePresetPost(
@ -521,7 +521,7 @@ int WebAPIAdapterGUI::instancePresetPost(
*response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
*response.getName() = selectedPreset->getDescription();
return 200;
return 202;
}
int WebAPIAdapterGUI::instancePresetDelete(
@ -549,7 +549,7 @@ int WebAPIAdapterGUI::instancePresetDelete(
MainWindow::MsgDeletePreset *msg = MainWindow::MsgDeletePreset::create(const_cast<Preset*>(selectedPreset));
m_mainWindow.m_inputMessageQueue.push(msg);
return 200;
return 202;
}
int WebAPIAdapterGUI::instanceDeviceSetsGet(
@ -571,7 +571,7 @@ int WebAPIAdapterGUI::instanceDeviceSetsPost(
response.init();
*response.getMessage() = QString("MsgAddDeviceSet message submitted");
return 200;
return 202;
}
int WebAPIAdapterGUI::instanceDeviceSetsDelete(
@ -586,7 +586,7 @@ int WebAPIAdapterGUI::instanceDeviceSetsDelete(
response.init();
*response.getMessage() = QString("MsgRemoveLastDeviceSet message submitted");
return 200;
return 202;
}
else
{
@ -680,7 +680,7 @@ int WebAPIAdapterGUI::devicesetDevicePut(
response.setDeviceSetIndex(deviceSetIndex);
response.setIndex(i);
return 200;
return 202;
}
*error.getMessage() = QString("Device not found");
@ -933,7 +933,7 @@ int WebAPIAdapterGUI::devicesetChannelPost(
response.init();
*response.getMessage() = QString("MsgAddChannel message submitted");
return 200;
return 202;
}
else
{
@ -969,7 +969,7 @@ int WebAPIAdapterGUI::devicesetChannelPost(
response.init();
*response.getMessage() = QString("MsgAddChannel message submitted");
return 200;
return 202;
}
else
{

View File

@ -87,15 +87,16 @@ int WebAPIAdapterSrv::instanceSummary(
}
int WebAPIAdapterSrv::instanceDelete(
SWGSDRangel::SWGInstanceSummaryResponse& response,
SWGSDRangel::SWGErrorResponse& error)
SWGSDRangel::SWGSuccessResponse& response,
SWGSDRangel::SWGErrorResponse& error __attribute__((unused)))
{
instanceSummary(response, error);
MainCore::MsgDeleteInstance *msg = MainCore::MsgDeleteInstance::create();
m_mainCore.getInputMessageQueue()->push(msg);
return 200;
response.init();
*response.getMessage() = QString("MsgDeleteInstance message submitted");
return 202;
}
int WebAPIAdapterSrv::instanceDevices(
@ -536,7 +537,7 @@ int WebAPIAdapterSrv::instancePresetPatch(
*response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
*response.getName() = selectedPreset->getDescription();
return 200;
return 202;
}
int WebAPIAdapterSrv::instancePresetPut(
@ -592,7 +593,7 @@ int WebAPIAdapterSrv::instancePresetPut(
*response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
*response.getName() = selectedPreset->getDescription();
return 200;
return 202;
}
int WebAPIAdapterSrv::instancePresetPost(
@ -648,7 +649,7 @@ int WebAPIAdapterSrv::instancePresetPost(
*response.getType() = selectedPreset->isSourcePreset() ? "R" : "T";
*response.getName() = selectedPreset->getDescription();
return 200;
return 202;
}
int WebAPIAdapterSrv::instancePresetDelete(
@ -676,7 +677,7 @@ int WebAPIAdapterSrv::instancePresetDelete(
MainCore::MsgDeletePreset *msg = MainCore::MsgDeletePreset::create(const_cast<Preset*>(selectedPreset));
m_mainCore.m_inputMessageQueue.push(msg);
return 200;
return 202;
}
int WebAPIAdapterSrv::instanceDeviceSetsGet(
@ -698,7 +699,7 @@ int WebAPIAdapterSrv::instanceDeviceSetsPost(
response.init();
*response.getMessage() = QString("MsgAddDeviceSet message submitted");
return 200;
return 202;
}
int WebAPIAdapterSrv::instanceDeviceSetsDelete(
@ -713,7 +714,7 @@ int WebAPIAdapterSrv::instanceDeviceSetsDelete(
response.init();
*response.getMessage() = QString("MsgRemoveLastDeviceSet message submitted");
return 200;
return 202;
}
else
{

View File

@ -37,7 +37,7 @@ public:
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceDelete(
SWGSDRangel::SWGInstanceSummaryResponse& response,
SWGSDRangel::SWGSuccessResponse& response,
SWGSDRangel::SWGErrorResponse& error);
virtual int instanceDevices(

View File

@ -66,8 +66,8 @@ paths:
tags:
- Instance
responses:
"200":
description: On success returns instance summary before it was closed
"202":
description: Message to stop the SDRangel instance was sent successfully
schema:
# a pointer to a definition
$ref: "#/definitions/InstanceSummaryResponse"
@ -320,8 +320,8 @@ paths:
schema:
$ref: "#/definitions/PresetTransfer"
responses:
"200":
description: On success return preset identification
"202":
description: On successful sending of the message the selected preset identification is returned
schema:
$ref: "#/definitions/PresetIdentifier"
"400":
@ -353,8 +353,8 @@ paths:
schema:
$ref: "#/definitions/PresetTransfer"
responses:
"200":
description: On success return preset identification
"202":
description: On successful sending of the message the selected preset identification is returned
schema:
$ref: "#/definitions/PresetIdentifier"
"400":
@ -386,8 +386,8 @@ paths:
schema:
$ref: "#/definitions/PresetTransfer"
responses:
"200":
description: On success return preset identification
"202":
description: On successful sending of the message the created preset identification is returned
schema:
$ref: "#/definitions/PresetIdentifier"
"400":
@ -423,8 +423,8 @@ paths:
schema:
$ref: "#/definitions/PresetIdentifier"
responses:
"200":
description: On success return deleted preset identification
"202":
description: On successful sending of the message the selected preset identification is returned
schema:
$ref: "#/definitions/PresetIdentifier"
"400":
@ -539,8 +539,8 @@ paths:
required: false
type: integer
responses:
"200":
description: On success return informative messsage
"202":
description: Message to add a new device set was sent successfully
schema:
$ref: "#/definitions/SuccessResponse"
"500":
@ -555,8 +555,8 @@ paths:
tags:
- Instance
responses:
"200":
description: On success return informative message
"202":
description: Message to remove last device set was sent successfully
schema:
$ref: "#/definitions/SuccessResponse"
"404":
@ -617,8 +617,8 @@ paths:
schema:
$ref: "#/definitions/DeviceListItem"
responses:
"200":
description: On success return details on the selected device
"202":
description: On successful semdomg of the message it returns the details of the device being set
schema:
$ref: "#/definitions/DeviceListItem"
"400":
@ -839,8 +839,8 @@ paths:
schema:
$ref: "#/definitions/ChannelSettings"
responses:
"200":
description: On success return informative message
"202":
description: Message to add a channel was sent successfully
schema:
$ref: "#/definitions/SuccessResponse"
"400":

View File

@ -2469,22 +2469,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return informative message </h3>
<h3> Status: 202 - Message to add a channel was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-devicesetChannelPost-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-devicesetChannelPost-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-devicesetChannelPost-200-schema">
<div id='responses-devicesetChannelPost-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-devicesetChannelPost-202-schema">
<div id='responses-devicesetChannelPost-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return informative message",
"description" : "Message to add a channel was sent successfully",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
@ -2501,14 +2501,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-devicesetChannelPost-200-schema-data').val(stringify(schema));
var result = $('#responses-devicesetChannelPost-200-schema-200');
$('#responses-devicesetChannelPost-202-schema-data').val(stringify(schema));
var result = $('#responses-devicesetChannelPost-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-devicesetChannelPost-200-schema-data' type='hidden' value=''></input>
<input id='responses-devicesetChannelPost-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -4324,22 +4324,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return details on the selected device </h3>
<h3> Status: 202 - On successful semdomg of the message it returns the details of the device being set </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-devicesetDevicePut-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-devicesetDevicePut-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-devicesetDevicePut-200-schema">
<div id='responses-devicesetDevicePut-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-devicesetDevicePut-202-schema">
<div id='responses-devicesetDevicePut-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return details on the selected device",
"description" : "On successful semdomg of the message it returns the details of the device being set",
"schema" : {
"$ref" : "#/definitions/DeviceListItem"
}
@ -4356,14 +4356,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-devicesetDevicePut-200-schema-data').val(stringify(schema));
var result = $('#responses-devicesetDevicePut-200-schema-200');
$('#responses-devicesetDevicePut-202-schema-data').val(stringify(schema));
var result = $('#responses-devicesetDevicePut-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-devicesetDevicePut-200-schema-data' type='hidden' value=''></input>
<input id='responses-devicesetDevicePut-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -8955,22 +8955,22 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success returns instance summary before it was closed </h3>
<h3> Status: 202 - Message to stop the SDRangel instance was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceDelete-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceDelete-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceDelete-200-schema">
<div id='responses-instanceDelete-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instanceDelete-202-schema">
<div id='responses-instanceDelete-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success returns instance summary before it was closed",
"description" : "Message to stop the SDRangel instance was sent successfully",
"schema" : {
"$ref" : "#/definitions/InstanceSummaryResponse"
}
@ -8987,14 +8987,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceDelete-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceDelete-200-schema-200');
$('#responses-instanceDelete-202-schema-data').val(stringify(schema));
var result = $('#responses-instanceDelete-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceDelete-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceDelete-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -9255,22 +9255,22 @@ except ApiException as e:
<h2>Responses</h2>
<h3> Status: 200 - On success return informative message </h3>
<h3> Status: 202 - Message to remove last device set was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceDeviceSetsDelete-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceDeviceSetsDelete-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceDeviceSetsDelete-200-schema">
<div id='responses-instanceDeviceSetsDelete-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instanceDeviceSetsDelete-202-schema">
<div id='responses-instanceDeviceSetsDelete-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return informative message",
"description" : "Message to remove last device set was sent successfully",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
@ -9287,14 +9287,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceDeviceSetsDelete-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsDelete-200-schema-200');
$('#responses-instanceDeviceSetsDelete-202-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsDelete-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceDeviceSetsDelete-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceDeviceSetsDelete-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -9936,22 +9936,22 @@ except ApiException as e:
</table>
<h2>Responses</h2>
<h3> Status: 200 - On success return informative messsage </h3>
<h3> Status: 202 - Message to add a new device set was sent successfully </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceDeviceSetsPost-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceDeviceSetsPost-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceDeviceSetsPost-200-schema">
<div id='responses-instanceDeviceSetsPost-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instanceDeviceSetsPost-202-schema">
<div id='responses-instanceDeviceSetsPost-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return informative messsage",
"description" : "Message to add a new device set was sent successfully",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
@ -9968,14 +9968,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceDeviceSetsPost-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsPost-200-schema-200');
$('#responses-instanceDeviceSetsPost-202-schema-data').val(stringify(schema));
var result = $('#responses-instanceDeviceSetsPost-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceDeviceSetsPost-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceDeviceSetsPost-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -11981,22 +11981,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return deleted preset identification </h3>
<h3> Status: 202 - On successful sending of the message the selected preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetDelete-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetDelete-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetDelete-200-schema">
<div id='responses-instancePresetDelete-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetDelete-202-schema">
<div id='responses-instancePresetDelete-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return deleted preset identification",
"description" : "On successful sending of the message the selected preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -12013,14 +12013,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetDelete-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetDelete-200-schema-200');
$('#responses-instancePresetDelete-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetDelete-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetDelete-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetDelete-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -13595,22 +13595,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return preset identification </h3>
<h3> Status: 202 - On successful sending of the message the selected preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetPatch-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetPatch-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetPatch-200-schema">
<div id='responses-instancePresetPatch-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetPatch-202-schema">
<div id='responses-instancePresetPatch-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return preset identification",
"description" : "On successful sending of the message the selected preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -13627,14 +13627,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetPatch-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPatch-200-schema-200');
$('#responses-instancePresetPatch-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPatch-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetPatch-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetPatch-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -14033,22 +14033,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return preset identification </h3>
<h3> Status: 202 - On successful sending of the message the created preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetPost-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetPost-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetPost-200-schema">
<div id='responses-instancePresetPost-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetPost-202-schema">
<div id='responses-instancePresetPost-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return preset identification",
"description" : "On successful sending of the message the created preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -14065,14 +14065,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetPost-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPost-200-schema-200');
$('#responses-instancePresetPost-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPost-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetPost-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetPost-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -14514,22 +14514,22 @@ $(document).ready(function() {
<h2>Responses</h2>
<h3> Status: 200 - On success return preset identification </h3>
<h3> Status: 202 - On successful sending of the message the selected preset identification is returned </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instancePresetPut-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instancePresetPut-202-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instancePresetPut-200-schema">
<div id='responses-instancePresetPut-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<div class="tab-pane active" id="responses-instancePresetPut-202-schema">
<div id='responses-instancePresetPut-202-schema-202' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
"description" : "On success return preset identification",
"description" : "On successful sending of the message the selected preset identification is returned",
"schema" : {
"$ref" : "#/definitions/PresetIdentifier"
}
@ -14546,14 +14546,14 @@ $(document).ready(function() {
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instancePresetPut-200-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPut-200-schema-200');
$('#responses-instancePresetPut-202-schema-data').val(stringify(schema));
var result = $('#responses-instancePresetPut-202-schema-202');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instancePresetPut-200-schema-data' type='hidden' value=''></input>
<input id='responses-instancePresetPut-202-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -15011,7 +15011,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2017-12-21T00:41:40.926+01:00
Generated 2017-12-21T15:48:45.512+01:00
</div>
</div>
</div>

View File

@ -36,7 +36,7 @@ def main():
base_url = "http://%s/sdrangel" % options.address
device_url = base_url + ("/deviceset/%d/channel" % options.device_index)
r = requests.post(url=device_url, json={"tx": 0, "channelType": options.channel_id})
if r.status_code == 200:
if r.status_code / 100 == 2:
print("Success")
print json.dumps(r.json(), indent=4, sort_keys=True)
else:

View File

@ -61,7 +61,7 @@ def main():
method = requests_methods.get(command[1], None)
if method is not None:
r = method(url=url, params=command[2], json=command[3])
if r.status_code == 200:
if r.status_code / 100 == 2:
print("Done: %s" % command[4])
else:
print("Error %d:%s" % (r.status_code, command[4]))

View File

@ -40,7 +40,7 @@ def callAPI(url, method, params, json, text):
request_method = requests_methods.get(method, None)
if request_method is not None:
r = request_method(url=base_url+url, params=params, json=json)
if r.status_code == 200:
if r.status_code / 100 == 2:
print(text + " succeeded")
printResponse(r)
return r.json() # all 200 yield application/json response

View File

@ -40,7 +40,7 @@ def callAPI(url, method, params, json, text):
request_method = requests_methods.get(method, None)
if request_method is not None:
r = request_method(url=base_url+url, params=params, json=json)
if r.status_code == 200:
if r.status_code / 100 == 2:
print(text + " succeeded")
printResponse(r)
return r.json() # all 200 yield application/json response

View File

@ -23,7 +23,7 @@ def getInputOptions():
def startDevice(deviceIndex):
dev_run_url = base_url+("/deviceset/%d/device/run" % deviceIndex)
r = requests.get(url=dev_run_url)
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
state = rj.get("state", None)
if state is not None:
@ -44,7 +44,7 @@ def startDevice(deviceIndex):
def stopDevice(deviceIndex):
dev_run_url = base_url+("/deviceset/%d/device/run" % deviceIndex)
r = requests.get(url=dev_run_url)
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
state = rj.get("state", None)
if state is not None:
@ -68,7 +68,7 @@ def main():
global base_url
base_url = "http://%s/sdrangel" % options.address
r = requests.get(url=base_url+"/devicesets")
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
deviceSets = rj.get("deviceSets", None)
if deviceSets is not None:

View File

@ -13,7 +13,7 @@ requests_methods = {
def getHwType():
r = requests.get(url=base_url+"/deviceset/0")
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
devj = rj.get('samplingDevice', None)
if devj is not None:
@ -25,7 +25,7 @@ def getHwType():
def selectRtlSdr():
r = requests.put(url=base_url+"/deviceset/0/device", json={"hwType": "RTLSDR"})
if r.status_code == 200:
if r.status_code / 100 == 2:
print json.dumps(r.json(), indent=4, sort_keys=True)
return True
else:
@ -33,7 +33,7 @@ def selectRtlSdr():
def getRtlSdrSettings():
r = requests.get(url=base_url+"/deviceset/0/device/settings")
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
hwType = rj.get('deviceHwType', None)
if hwType is not None and hwType == "RTLSDR":
@ -47,7 +47,7 @@ def getRtlSdrSettings():
def patchRtlSdrSettings(settings):
new_settings = {"deviceHwType": "RTLSDR", "tx": 0, "rtlSdrSettings": settings}
r = requests.patch(url=base_url+"/deviceset/0/device/settings", json=new_settings)
if r.status_code == 200:
if r.status_code / 100 == 2:
print json.dumps(r.json(), indent=4, sort_keys=True)
else:
print "Error HTTP:", r.status_code
@ -57,7 +57,7 @@ def deviceRun(run):
r = requests.post(url=base_url+"/deviceset/0/device/run")
else:
r = requests.delete(url=base_url+"/deviceset/0/device/run")
if r.status_code == 200:
if r.status_code / 100 == 2:
print json.dumps(r.json(), indent=4, sort_keys=True)
else:
print "Error HTTP:", r.status_code

View File

@ -36,7 +36,7 @@ def getInputOptions():
def startDevice(deviceIndex):
dev_run_url = base_url+("/deviceset/%d/device/run" % deviceIndex)
r = requests.get(url=dev_run_url)
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
state = rj.get("state", None)
if state is not None:
@ -57,7 +57,7 @@ def startDevice(deviceIndex):
def stopDevice(deviceIndex):
dev_run_url = base_url+("/deviceset/%d/device/run" % deviceIndex)
r = requests.get(url=dev_run_url)
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
state = rj.get("state", None)
if state is not None:
@ -81,7 +81,7 @@ def main():
global base_url
base_url = "http://%s/sdrangel" % options.address
r = requests.get(url=base_url+"/devicesets")
if r.status_code == 200:
if r.status_code / 100 == 2:
rj = r.json()
deviceSets = rj.get("deviceSets", None)
if deviceSets is not None:

View File

@ -40,7 +40,7 @@ def callAPI(url, method, params, json, text):
request_method = requests_methods.get(method, None)
if request_method is not None:
r = request_method(url=base_url+url, params=params, json=json)
if r.status_code == 200:
if r.status_code / 100 == 2:
print(text + " succeeded")
printResponse(r)
return r.json() # all 200 yield application/json response