1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-17 13:51:47 -05:00

REST API: config: PUT (1): swagger implementation. Various small fixes

This commit is contained in:
f4exb 2019-08-05 18:29:09 +02:00
parent a88556d6f6
commit f80d16451b
13 changed files with 1033 additions and 145 deletions

View File

@ -585,7 +585,7 @@ int TestMI::webapiSettingsPutPatch(
return 200;
}
void webapiUpdateDeviceSettings(
void TestMI::webapiUpdateDeviceSettings(
TestMISettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)

View File

@ -605,7 +605,7 @@ int Bladerf1Output::webapiSettingsPutPatch(
return 200;
}
void webapiUpdateDeviceSettings(
void Bladerf1Output::webapiUpdateDeviceSettings(
BladeRF1OutputSettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)

View File

@ -981,7 +981,7 @@ int BladeRF2Output::webapiSettingsPutPatch(
return 200;
}
void webapiUpdateDeviceSettings(
void BladeRF2Output::webapiUpdateDeviceSettings(
BladeRF2OutputSettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)

View File

@ -1200,7 +1200,7 @@ int XTRXOutput::webapiSettingsPutPatch(
return 200;
}
void webapiUpdateDeviceSettings(
void XTRXOutput::webapiUpdateDeviceSettings(
XTRXOutputSettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)

View File

@ -810,7 +810,7 @@ int PlutoSDRInput::webapiSettingsPutPatch(
return 200;
}
void webapiUpdateDeviceSettings(
void PlutoSDRInput::webapiUpdateDeviceSettings(
PlutoSDRInputSettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)

View File

@ -348,7 +348,7 @@ int RemoteInput::webapiSettingsPutPatch(
return 200;
}
void webapiUpdateDeviceSettings(
void RemoteInput::webapiUpdateDeviceSettings(
RemoteInputSettings& settings,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response)

View File

@ -26,6 +26,8 @@ QString DeviceUtils::getRegisteredDeviceURI(const QString& xDeviceURI)
{
if (xDeviceURI == "sdrangel.samplesource.bladerf") {
return "sdrangel.samplesource.bladerf1input";
} else if (xDeviceURI == "sdrangel.samplesource.filesource") {
return "sdrangel.samplesource.fileinput";
} else {
return xDeviceURI;
}

View File

@ -6514,8 +6514,11 @@ margin-bottom: 20px;
<li data-group="Instance" data-name="instanceChannels" class="">
<a href="#api-Instance-instanceChannels">instanceChannels</a>
</li>
<li data-group="Instance" data-name="instanceConfig" class="">
<a href="#api-Instance-instanceConfig">instanceConfig</a>
<li data-group="Instance" data-name="instanceConfigGet" class="">
<a href="#api-Instance-instanceConfigGet">instanceConfigGet</a>
</li>
<li data-group="Instance" data-name="instanceConfigPut" class="">
<a href="#api-Instance-instanceConfigPut">instanceConfigPut</a>
</li>
<li data-group="Instance" data-name="instanceDelete" class="">
<a href="#api-Instance-instanceDelete">instanceDelete</a>
@ -20474,16 +20477,16 @@ except ApiException as e:
</article>
</div>
<hr>
<div id="api-Instance-instanceConfig">
<article id="api-Instance-instanceConfig-0" data-group="User" data-name="instanceConfig" data-version="0">
<div id="api-Instance-instanceConfigGet">
<article id="api-Instance-instanceConfigGet-0" data-group="User" data-name="instanceConfigGet" data-version="0">
<div class="pull-left">
<h1>instanceConfig</h1>
<h1>instanceConfigGet</h1>
<p></p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
<p></p>
<p class="marked">Get the Preferences, Presets and Commands of the MainSettings saved by Qt</p>
<p class="marked">Get the Preferences, Presets and Commands of the MainSettings saved by Qt. Supports config backup.</p>
<p></p>
<br />
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/sdrangel/config</span></code></pre>
@ -20491,24 +20494,24 @@ except ApiException as e:
<h3>Usage and SDK Samples</h3>
</p>
<ul class="nav nav-tabs nav-tabs-examples">
<li class="active"><a href="#examples-Instance-instanceConfig-0-curl">Curl</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-java">Java</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfig-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfig-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfig-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfig-0-csharp">C#</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-php">PHP</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-perl">Perl</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-python">Python</a></li>
<li class="active"><a href="#examples-Instance-instanceConfigGet-0-curl">Curl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-java">Java</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigGet-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigGet-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigGet-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigGet-0-csharp">C#</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-php">PHP</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-perl">Perl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-python">Python</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="examples-Instance-instanceConfig-0-curl">
<div class="tab-pane active" id="examples-Instance-instanceConfigGet-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/sdrangel/config"</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-java">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-java">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
import SWGSDRangel.auth.*;
import SWGSDRangel.model.*;
@ -20523,17 +20526,17 @@ public class InstanceApiExample {
InstanceApi apiInstance = new InstanceApi();
try {
InstanceConfigResponse result = apiInstance.instanceConfig();
InstanceConfigResponse result = apiInstance.instanceConfigGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfig");
System.err.println("Exception when calling InstanceApi#instanceConfigGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-android">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-android">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.InstanceApi;
public class InstanceApiExample {
@ -20541,24 +20544,24 @@ public class InstanceApiExample {
public static void main(String[] args) {
InstanceApi apiInstance = new InstanceApi();
try {
InstanceConfigResponse result = apiInstance.instanceConfig();
InstanceConfigResponse result = apiInstance.instanceConfigGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfig");
System.err.println("Exception when calling InstanceApi#instanceConfigGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<!--
<div class="tab-pane" id="examples-Instance-instanceConfig-0-groovy">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-groovy">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div> -->
<div class="tab-pane" id="examples-Instance-instanceConfig-0-objc">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-objc">
<pre class="prettyprint"><code class="language-cpp">
InstanceApi *apiInstance = [[InstanceApi alloc] init];
[apiInstance instanceConfigWithCompletionHandler:
[apiInstance instanceConfigGetWithCompletionHandler:
^(InstanceConfigResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
@ -20570,7 +20573,7 @@ InstanceApi *apiInstance = [[InstanceApi alloc] init];
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-javascript">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-javascript">
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
var api = new SdRangel.InstanceApi()
@ -20582,14 +20585,14 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
api.instanceConfig(callback);
api.instanceConfigGet(callback);
</code></pre>
</div>
<!--<div class="tab-pane" id="examples-Instance-instanceConfig-0-angular">
<!--<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-angular">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div>-->
<div class="tab-pane" id="examples-Instance-instanceConfig-0-csharp">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-csharp">
<pre class="prettyprint"><code class="language-cs">using System;
using System.Diagnostics;
using SWGSDRangel.Api;
@ -20598,7 +20601,7 @@ using SWGSDRangel.Model;
namespace Example
{
public class instanceConfigExample
public class instanceConfigGetExample
{
public void main()
{
@ -20607,12 +20610,12 @@ namespace Example
try
{
InstanceConfigResponse result = apiInstance.instanceConfig();
InstanceConfigResponse result = apiInstance.instanceConfigGet();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling InstanceApi.instanceConfig: " + e.Message );
Debug.Print("Exception when calling InstanceApi.instanceConfigGet: " + e.Message );
}
}
}
@ -20620,22 +20623,22 @@ namespace Example
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-php">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-php">
<pre class="prettyprint"><code class="language-php"><&#63;php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\InstanceApi();
try {
$result = $api_instance->instanceConfig();
$result = $api_instance->instanceConfigGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->instanceConfig: ', $e->getMessage(), PHP_EOL;
echo 'Exception when calling InstanceApi->instanceConfigGet: ', $e->getMessage(), PHP_EOL;
}
?></code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-perl">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-perl">
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
use SWGSDRangel::Configuration;
use SWGSDRangel::InstanceApi;
@ -20643,15 +20646,15 @@ use SWGSDRangel::InstanceApi;
my $api_instance = SWGSDRangel::InstanceApi->new();
eval {
my $result = $api_instance->instanceConfig();
my $result = $api_instance->instanceConfigGet();
print Dumper($result);
};
if ($@) {
warn "Exception when calling InstanceApi->instanceConfig: $@\n";
warn "Exception when calling InstanceApi->instanceConfigGet: $@\n";
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-python">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-python">
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
import time
import swagger_sdrangel
@ -20662,10 +20665,10 @@ from pprint import pprint
api_instance = swagger_sdrangel.InstanceApi()
try:
api_response = api_instance.instance_config()
api_response = api_instance.instance_config_get()
pprint(api_response)
except ApiException as e:
print("Exception when calling InstanceApi->instanceConfig: %s\n" % e)</code></pre>
print("Exception when calling InstanceApi->instanceConfigGet: %s\n" % e)</code></pre>
</div>
</div>
@ -20681,14 +20684,14 @@ except ApiException as e:
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfig-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceConfigGet-200-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfig-200-schema">
<div id='responses-instanceConfig-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-instanceConfigGet-200-schema">
<div id='responses-instanceConfigGet-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
@ -20709,14 +20712,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfig-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfig-200-schema-200');
$('#responses-instanceConfigGet-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigGet-200-schema-200');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfig-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceConfigGet-200-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -20724,14 +20727,14 @@ except ApiException as e:
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfig-500-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceConfigGet-500-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfig-500-schema">
<div id='responses-instanceConfig-500-schema-500' 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-instanceConfigGet-500-schema">
<div id='responses-instanceConfigGet-500-schema-500' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
@ -20752,14 +20755,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfig-500-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfig-500-schema-500');
$('#responses-instanceConfigGet-500-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigGet-500-schema-500');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfig-500-schema-data' type='hidden' value=''></input>
<input id='responses-instanceConfigGet-500-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -20767,14 +20770,14 @@ except ApiException as e:
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfig-501-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceConfigGet-501-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfig-501-schema">
<div id='responses-instanceConfig-501-schema-501' 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-instanceConfigGet-501-schema">
<div id='responses-instanceConfigGet-501-schema-501' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
@ -20795,14 +20798,401 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfig-501-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfig-501-schema-501');
$('#responses-instanceConfigGet-501-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigGet-501-schema-501');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfig-501-schema-data' type='hidden' value=''></input>
<input id='responses-instanceConfigGet-501-schema-data' type='hidden' value=''></input>
</div>
</div>
</article>
</div>
<hr>
<div id="api-Instance-instanceConfigPut">
<article id="api-Instance-instanceConfigPut-0" data-group="User" data-name="instanceConfigPut" data-version="0">
<div class="pull-left">
<h1>instanceConfigPut</h1>
<p></p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
<p></p>
<p class="marked">Replace the Preferences, Presets and Commands of the MainSettings object with the contents of the payload. Supports config restore.</p>
<p></p>
<br />
<pre class="prettyprint language-html prettyprinted" data-type="put"><code><span class="pln">/sdrangel/config</span></code></pre>
<p>
<h3>Usage and SDK Samples</h3>
</p>
<ul class="nav nav-tabs nav-tabs-examples">
<li class="active"><a href="#examples-Instance-instanceConfigPut-0-curl">Curl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-java">Java</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigPut-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigPut-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigPut-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigPut-0-csharp">C#</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-php">PHP</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-perl">Perl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-python">Python</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="examples-Instance-instanceConfigPut-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X PUT "http://localhost/sdrangel/config"</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-java">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
import SWGSDRangel.auth.*;
import SWGSDRangel.model.*;
import SWGSDRangel.api.InstanceApi;
import java.io.File;
import java.util.*;
public class InstanceApiExample {
public static void main(String[] args) {
InstanceApi apiInstance = new InstanceApi();
InstanceConfigResponse body = ; // InstanceConfigResponse | Config information
try {
SuccessResponse result = apiInstance.instanceConfigPut(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfigPut");
e.printStackTrace();
}
}
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-android">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.InstanceApi;
public class InstanceApiExample {
public static void main(String[] args) {
InstanceApi apiInstance = new InstanceApi();
InstanceConfigResponse body = ; // InstanceConfigResponse | Config information
try {
SuccessResponse result = apiInstance.instanceConfigPut(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfigPut");
e.printStackTrace();
}
}
}</code></pre>
</div>
<!--
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-groovy">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div> -->
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-objc">
<pre class="prettyprint"><code class="language-cpp">InstanceConfigResponse *body = ; // Config information
InstanceApi *apiInstance = [[InstanceApi alloc] init];
[apiInstance instanceConfigPutWith:body
completionHandler: ^(SuccessResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-javascript">
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
var api = new SdRangel.InstanceApi()
var body = ; // {InstanceConfigResponse} Config information
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.instanceConfigPut(body, callback);
</code></pre>
</div>
<!--<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-angular">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div>-->
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-csharp">
<pre class="prettyprint"><code class="language-cs">using System;
using System.Diagnostics;
using SWGSDRangel.Api;
using SWGSDRangel.Client;
using SWGSDRangel.Model;
namespace Example
{
public class instanceConfigPutExample
{
public void main()
{
var apiInstance = new InstanceApi();
var body = new InstanceConfigResponse(); // InstanceConfigResponse | Config information
try
{
SuccessResponse result = apiInstance.instanceConfigPut(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling InstanceApi.instanceConfigPut: " + e.Message );
}
}
}
}
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-php">
<pre class="prettyprint"><code class="language-php"><&#63;php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\InstanceApi();
$body = ; // InstanceConfigResponse | Config information
try {
$result = $api_instance->instanceConfigPut($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->instanceConfigPut: ', $e->getMessage(), PHP_EOL;
}
?></code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-perl">
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
use SWGSDRangel::Configuration;
use SWGSDRangel::InstanceApi;
my $api_instance = SWGSDRangel::InstanceApi->new();
my $body = SWGSDRangel::Object::InstanceConfigResponse->new(); # InstanceConfigResponse | Config information
eval {
my $result = $api_instance->instanceConfigPut(body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling InstanceApi->instanceConfigPut: $@\n";
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-python">
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
import time
import swagger_sdrangel
from swagger_sdrangel.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_sdrangel.InstanceApi()
body = # InstanceConfigResponse | Config information
try:
api_response = api_instance.instance_config_put(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling InstanceApi->instanceConfigPut: %s\n" % e)</code></pre>
</div>
</div>
<h2>Parameters</h2>
<div class="methodsubtabletitle">Body parameters</div>
<table id="methodsubtable">
<tr>
<th width="150px">Name</th>
<th>Description</th>
</tr>
<tr><td style="width:150px;">body <span style="color:red;">*</span></td>
<td>
<script>
$(document).ready(function() {
var schemaWrapper = {
"in" : "body",
"name" : "body",
"description" : "Config information",
"required" : true,
"schema" : {
"$ref" : "#/definitions/InstanceConfigResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
var view = new JSONSchemaView(schema,2,{isBodyParam: true});
var result = $('#d2e199_instanceConfigPut_body');
result.empty();
result.append(view.render());
});
</script>
<div id="d2e199_instanceConfigPut_body"></div>
</td>
</tr>
</table>
<h2>Responses</h2>
<h3> Status: 200 - Success </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfigPut-200-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfigPut-200-schema">
<div id='responses-instanceConfigPut-200-schema-200' 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" : "Success",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfigPut-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigPut-200-schema-200');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfigPut-200-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 500 - Error </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfigPut-500-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfigPut-500-schema">
<div id='responses-instanceConfigPut-500-schema-500' 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" : "Error",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfigPut-500-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigPut-500-schema-500');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfigPut-500-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 501 - Function not implemented </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfigPut-501-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfigPut-501-schema">
<div id='responses-instanceConfigPut-501-schema-501' 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" : "Function not implemented",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfigPut-501-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigPut-501-schema-501');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfigPut-501-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -26955,7 +27345,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2019-08-05T03:02:48.921+02:00
Generated 2019-08-05T18:13:15.915+02:00
</div>
</div>
</div>

View File

@ -78,8 +78,8 @@ paths:
/sdrangel/config:
x-swagger-router-controller: instance
get:
description: Get the Preferences, Presets and Commands of the MainSettings saved by Qt
operationId: instanceConfig
description: Get the Preferences, Presets and Commands of the MainSettings saved by Qt. Supports config backup.
operationId: instanceConfigGet
tags:
- Instance
responses:
@ -92,6 +92,29 @@ paths:
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Replace the Preferences, Presets and Commands of the MainSettings object with the contents of the payload. Supports config restore.
operationId: instanceConfigPut
tags:
- Instance
consumes:
- application/json
parameters:
- name: body
in: body
description: Config information
required: true
schema:
$ref: "#/definitions/InstanceConfigResponse"
responses:
"200":
description: Success
schema:
$ref: "#/definitions/SuccessResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrangel/devices:
x-swagger-router-controller: instance

View File

@ -78,8 +78,8 @@ paths:
/sdrangel/config:
x-swagger-router-controller: instance
get:
description: Get the Preferences, Presets and Commands of the MainSettings saved by Qt
operationId: instanceConfig
description: Get the Preferences, Presets and Commands of the MainSettings saved by Qt. Supports config backup.
operationId: instanceConfigGet
tags:
- Instance
responses:
@ -92,6 +92,29 @@ paths:
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
put:
description: Replace the Preferences, Presets and Commands of the MainSettings object with the contents of the payload. Supports config restore.
operationId: instanceConfigPut
tags:
- Instance
consumes:
- application/json
parameters:
- name: body
in: body
description: Config information
required: true
schema:
$ref: "#/definitions/InstanceConfigResponse"
responses:
"200":
description: Success
schema:
$ref: "#/definitions/SuccessResponse"
"500":
$ref: "#/responses/Response_500"
"501":
$ref: "#/responses/Response_501"
/sdrangel/devices:
x-swagger-router-controller: instance

View File

@ -6514,8 +6514,11 @@ margin-bottom: 20px;
<li data-group="Instance" data-name="instanceChannels" class="">
<a href="#api-Instance-instanceChannels">instanceChannels</a>
</li>
<li data-group="Instance" data-name="instanceConfig" class="">
<a href="#api-Instance-instanceConfig">instanceConfig</a>
<li data-group="Instance" data-name="instanceConfigGet" class="">
<a href="#api-Instance-instanceConfigGet">instanceConfigGet</a>
</li>
<li data-group="Instance" data-name="instanceConfigPut" class="">
<a href="#api-Instance-instanceConfigPut">instanceConfigPut</a>
</li>
<li data-group="Instance" data-name="instanceDelete" class="">
<a href="#api-Instance-instanceDelete">instanceDelete</a>
@ -20474,16 +20477,16 @@ except ApiException as e:
</article>
</div>
<hr>
<div id="api-Instance-instanceConfig">
<article id="api-Instance-instanceConfig-0" data-group="User" data-name="instanceConfig" data-version="0">
<div id="api-Instance-instanceConfigGet">
<article id="api-Instance-instanceConfigGet-0" data-group="User" data-name="instanceConfigGet" data-version="0">
<div class="pull-left">
<h1>instanceConfig</h1>
<h1>instanceConfigGet</h1>
<p></p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
<p></p>
<p class="marked">Get the Preferences, Presets and Commands of the MainSettings saved by Qt</p>
<p class="marked">Get the Preferences, Presets and Commands of the MainSettings saved by Qt. Supports config backup.</p>
<p></p>
<br />
<pre class="prettyprint language-html prettyprinted" data-type="get"><code><span class="pln">/sdrangel/config</span></code></pre>
@ -20491,24 +20494,24 @@ except ApiException as e:
<h3>Usage and SDK Samples</h3>
</p>
<ul class="nav nav-tabs nav-tabs-examples">
<li class="active"><a href="#examples-Instance-instanceConfig-0-curl">Curl</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-java">Java</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfig-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfig-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfig-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfig-0-csharp">C#</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-php">PHP</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-perl">Perl</a></li>
<li class=""><a href="#examples-Instance-instanceConfig-0-python">Python</a></li>
<li class="active"><a href="#examples-Instance-instanceConfigGet-0-curl">Curl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-java">Java</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigGet-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigGet-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigGet-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigGet-0-csharp">C#</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-php">PHP</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-perl">Perl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigGet-0-python">Python</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="examples-Instance-instanceConfig-0-curl">
<div class="tab-pane active" id="examples-Instance-instanceConfigGet-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/sdrangel/config"</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-java">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-java">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
import SWGSDRangel.auth.*;
import SWGSDRangel.model.*;
@ -20523,17 +20526,17 @@ public class InstanceApiExample {
InstanceApi apiInstance = new InstanceApi();
try {
InstanceConfigResponse result = apiInstance.instanceConfig();
InstanceConfigResponse result = apiInstance.instanceConfigGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfig");
System.err.println("Exception when calling InstanceApi#instanceConfigGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-android">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-android">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.InstanceApi;
public class InstanceApiExample {
@ -20541,24 +20544,24 @@ public class InstanceApiExample {
public static void main(String[] args) {
InstanceApi apiInstance = new InstanceApi();
try {
InstanceConfigResponse result = apiInstance.instanceConfig();
InstanceConfigResponse result = apiInstance.instanceConfigGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfig");
System.err.println("Exception when calling InstanceApi#instanceConfigGet");
e.printStackTrace();
}
}
}</code></pre>
</div>
<!--
<div class="tab-pane" id="examples-Instance-instanceConfig-0-groovy">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-groovy">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div> -->
<div class="tab-pane" id="examples-Instance-instanceConfig-0-objc">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-objc">
<pre class="prettyprint"><code class="language-cpp">
InstanceApi *apiInstance = [[InstanceApi alloc] init];
[apiInstance instanceConfigWithCompletionHandler:
[apiInstance instanceConfigGetWithCompletionHandler:
^(InstanceConfigResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
@ -20570,7 +20573,7 @@ InstanceApi *apiInstance = [[InstanceApi alloc] init];
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-javascript">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-javascript">
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
var api = new SdRangel.InstanceApi()
@ -20582,14 +20585,14 @@ var callback = function(error, data, response) {
console.log('API called successfully. Returned data: ' + data);
}
};
api.instanceConfig(callback);
api.instanceConfigGet(callback);
</code></pre>
</div>
<!--<div class="tab-pane" id="examples-Instance-instanceConfig-0-angular">
<!--<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-angular">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div>-->
<div class="tab-pane" id="examples-Instance-instanceConfig-0-csharp">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-csharp">
<pre class="prettyprint"><code class="language-cs">using System;
using System.Diagnostics;
using SWGSDRangel.Api;
@ -20598,7 +20601,7 @@ using SWGSDRangel.Model;
namespace Example
{
public class instanceConfigExample
public class instanceConfigGetExample
{
public void main()
{
@ -20607,12 +20610,12 @@ namespace Example
try
{
InstanceConfigResponse result = apiInstance.instanceConfig();
InstanceConfigResponse result = apiInstance.instanceConfigGet();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling InstanceApi.instanceConfig: " + e.Message );
Debug.Print("Exception when calling InstanceApi.instanceConfigGet: " + e.Message );
}
}
}
@ -20620,22 +20623,22 @@ namespace Example
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-php">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-php">
<pre class="prettyprint"><code class="language-php"><&#63;php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\InstanceApi();
try {
$result = $api_instance->instanceConfig();
$result = $api_instance->instanceConfigGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->instanceConfig: ', $e->getMessage(), PHP_EOL;
echo 'Exception when calling InstanceApi->instanceConfigGet: ', $e->getMessage(), PHP_EOL;
}
?></code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-perl">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-perl">
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
use SWGSDRangel::Configuration;
use SWGSDRangel::InstanceApi;
@ -20643,15 +20646,15 @@ use SWGSDRangel::InstanceApi;
my $api_instance = SWGSDRangel::InstanceApi->new();
eval {
my $result = $api_instance->instanceConfig();
my $result = $api_instance->instanceConfigGet();
print Dumper($result);
};
if ($@) {
warn "Exception when calling InstanceApi->instanceConfig: $@\n";
warn "Exception when calling InstanceApi->instanceConfigGet: $@\n";
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfig-0-python">
<div class="tab-pane" id="examples-Instance-instanceConfigGet-0-python">
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
import time
import swagger_sdrangel
@ -20662,10 +20665,10 @@ from pprint import pprint
api_instance = swagger_sdrangel.InstanceApi()
try:
api_response = api_instance.instance_config()
api_response = api_instance.instance_config_get()
pprint(api_response)
except ApiException as e:
print("Exception when calling InstanceApi->instanceConfig: %s\n" % e)</code></pre>
print("Exception when calling InstanceApi->instanceConfigGet: %s\n" % e)</code></pre>
</div>
</div>
@ -20681,14 +20684,14 @@ except ApiException as e:
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfig-200-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceConfigGet-200-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfig-200-schema">
<div id='responses-instanceConfig-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-instanceConfigGet-200-schema">
<div id='responses-instanceConfigGet-200-schema-200' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
@ -20709,14 +20712,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfig-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfig-200-schema-200');
$('#responses-instanceConfigGet-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigGet-200-schema-200');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfig-200-schema-data' type='hidden' value=''></input>
<input id='responses-instanceConfigGet-200-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -20724,14 +20727,14 @@ except ApiException as e:
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfig-500-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceConfigGet-500-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfig-500-schema">
<div id='responses-instanceConfig-500-schema-500' 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-instanceConfigGet-500-schema">
<div id='responses-instanceConfigGet-500-schema-500' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
@ -20752,14 +20755,14 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfig-500-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfig-500-schema-500');
$('#responses-instanceConfigGet-500-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigGet-500-schema-500');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfig-500-schema-data' type='hidden' value=''></input>
<input id='responses-instanceConfigGet-500-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -20767,14 +20770,14 @@ except ApiException as e:
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfig-501-schema">Schema</a>
<a data-toggle="tab" href="#responses-instanceConfigGet-501-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfig-501-schema">
<div id='responses-instanceConfig-501-schema-501' 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-instanceConfigGet-501-schema">
<div id='responses-instanceConfigGet-501-schema-501' style="padding: 30px; border-left: 1px solid #eee; border-right: 1px solid #eee; border-bottom: 1px solid #eee;">
<script>
$(document).ready(function() {
var schemaWrapper = {
@ -20795,14 +20798,401 @@ except ApiException as e:
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfig-501-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfig-501-schema-501');
$('#responses-instanceConfigGet-501-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigGet-501-schema-501');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfig-501-schema-data' type='hidden' value=''></input>
<input id='responses-instanceConfigGet-501-schema-data' type='hidden' value=''></input>
</div>
</div>
</article>
</div>
<hr>
<div id="api-Instance-instanceConfigPut">
<article id="api-Instance-instanceConfigPut-0" data-group="User" data-name="instanceConfigPut" data-version="0">
<div class="pull-left">
<h1>instanceConfigPut</h1>
<p></p>
</div>
<div class="pull-right"></div>
<div class="clearfix"></div>
<p></p>
<p class="marked">Replace the Preferences, Presets and Commands of the MainSettings object with the contents of the payload. Supports config restore.</p>
<p></p>
<br />
<pre class="prettyprint language-html prettyprinted" data-type="put"><code><span class="pln">/sdrangel/config</span></code></pre>
<p>
<h3>Usage and SDK Samples</h3>
</p>
<ul class="nav nav-tabs nav-tabs-examples">
<li class="active"><a href="#examples-Instance-instanceConfigPut-0-curl">Curl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-java">Java</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-android">Android</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigPut-0-groovy">Groovy</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigPut-0-objc">Obj-C</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-javascript">JavaScript</a></li>
<!--<li class=""><a href="#examples-Instance-instanceConfigPut-0-angular">Angular</a></li>-->
<li class=""><a href="#examples-Instance-instanceConfigPut-0-csharp">C#</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-php">PHP</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-perl">Perl</a></li>
<li class=""><a href="#examples-Instance-instanceConfigPut-0-python">Python</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="examples-Instance-instanceConfigPut-0-curl">
<pre class="prettyprint"><code class="language-bsh">curl -X PUT "http://localhost/sdrangel/config"</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-java">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.*;
import SWGSDRangel.auth.*;
import SWGSDRangel.model.*;
import SWGSDRangel.api.InstanceApi;
import java.io.File;
import java.util.*;
public class InstanceApiExample {
public static void main(String[] args) {
InstanceApi apiInstance = new InstanceApi();
InstanceConfigResponse body = ; // InstanceConfigResponse | Config information
try {
SuccessResponse result = apiInstance.instanceConfigPut(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfigPut");
e.printStackTrace();
}
}
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-android">
<pre class="prettyprint"><code class="language-java">import SWGSDRangel.api.InstanceApi;
public class InstanceApiExample {
public static void main(String[] args) {
InstanceApi apiInstance = new InstanceApi();
InstanceConfigResponse body = ; // InstanceConfigResponse | Config information
try {
SuccessResponse result = apiInstance.instanceConfigPut(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstanceApi#instanceConfigPut");
e.printStackTrace();
}
}
}</code></pre>
</div>
<!--
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-groovy">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div> -->
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-objc">
<pre class="prettyprint"><code class="language-cpp">InstanceConfigResponse *body = ; // Config information
InstanceApi *apiInstance = [[InstanceApi alloc] init];
[apiInstance instanceConfigPutWith:body
completionHandler: ^(SuccessResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-javascript">
<pre class="prettyprint"><code class="language-js">var SdRangel = require('sd_rangel');
var api = new SdRangel.InstanceApi()
var body = ; // {InstanceConfigResponse} Config information
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.instanceConfigPut(body, callback);
</code></pre>
</div>
<!--<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-angular">
<pre class="prettyprint language-json prettyprinted" data-type="json"><code>Coming Soon!</code></pre>
</div>-->
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-csharp">
<pre class="prettyprint"><code class="language-cs">using System;
using System.Diagnostics;
using SWGSDRangel.Api;
using SWGSDRangel.Client;
using SWGSDRangel.Model;
namespace Example
{
public class instanceConfigPutExample
{
public void main()
{
var apiInstance = new InstanceApi();
var body = new InstanceConfigResponse(); // InstanceConfigResponse | Config information
try
{
SuccessResponse result = apiInstance.instanceConfigPut(body);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling InstanceApi.instanceConfigPut: " + e.Message );
}
}
}
}
</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-php">
<pre class="prettyprint"><code class="language-php"><&#63;php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\Api\InstanceApi();
$body = ; // InstanceConfigResponse | Config information
try {
$result = $api_instance->instanceConfigPut($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstanceApi->instanceConfigPut: ', $e->getMessage(), PHP_EOL;
}
?></code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-perl">
<pre class="prettyprint"><code class="language-perl">use Data::Dumper;
use SWGSDRangel::Configuration;
use SWGSDRangel::InstanceApi;
my $api_instance = SWGSDRangel::InstanceApi->new();
my $body = SWGSDRangel::Object::InstanceConfigResponse->new(); # InstanceConfigResponse | Config information
eval {
my $result = $api_instance->instanceConfigPut(body => $body);
print Dumper($result);
};
if ($@) {
warn "Exception when calling InstanceApi->instanceConfigPut: $@\n";
}</code></pre>
</div>
<div class="tab-pane" id="examples-Instance-instanceConfigPut-0-python">
<pre class="prettyprint"><code class="language-python">from __future__ import print_statement
import time
import swagger_sdrangel
from swagger_sdrangel.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_sdrangel.InstanceApi()
body = # InstanceConfigResponse | Config information
try:
api_response = api_instance.instance_config_put(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling InstanceApi->instanceConfigPut: %s\n" % e)</code></pre>
</div>
</div>
<h2>Parameters</h2>
<div class="methodsubtabletitle">Body parameters</div>
<table id="methodsubtable">
<tr>
<th width="150px">Name</th>
<th>Description</th>
</tr>
<tr><td style="width:150px;">body <span style="color:red;">*</span></td>
<td>
<script>
$(document).ready(function() {
var schemaWrapper = {
"in" : "body",
"name" : "body",
"description" : "Config information",
"required" : true,
"schema" : {
"$ref" : "#/definitions/InstanceConfigResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
var view = new JSONSchemaView(schema,2,{isBodyParam: true});
var result = $('#d2e199_instanceConfigPut_body');
result.empty();
result.append(view.render());
});
</script>
<div id="d2e199_instanceConfigPut_body"></div>
</td>
</tr>
</table>
<h2>Responses</h2>
<h3> Status: 200 - Success </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfigPut-200-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfigPut-200-schema">
<div id='responses-instanceConfigPut-200-schema-200' 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" : "Success",
"schema" : {
"$ref" : "#/definitions/SuccessResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfigPut-200-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigPut-200-schema-200');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfigPut-200-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 500 - Error </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfigPut-500-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfigPut-500-schema">
<div id='responses-instanceConfigPut-500-schema-500' 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" : "Error",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfigPut-500-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigPut-500-schema-500');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfigPut-500-schema-data' type='hidden' value=''></input>
</div>
</div>
<h3> Status: 501 - Function not implemented </h3>
<ul class="nav nav-tabs nav-tabs-examples" >
<li class="active">
<a data-toggle="tab" href="#responses-instanceConfigPut-501-schema">Schema</a>
</li>
</ul>
<div class="tab-content" style='margin-bottom: 10px;'>
<div class="tab-pane active" id="responses-instanceConfigPut-501-schema">
<div id='responses-instanceConfigPut-501-schema-501' 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" : "Function not implemented",
"schema" : {
"$ref" : "#/definitions/ErrorResponse"
}
};
var schema = schemaWrapper.schema;
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
} else {
schemaWrapper.definitions = Object.assign({}, defs);
$RefParser.dereference(schemaWrapper).catch(function(err) {
console.log(err);
});
}
//console.log(JSON.stringify(schema));
var view = new JSONSchemaView(schema, 3);
$('#responses-instanceConfigPut-501-schema-data').val(stringify(schema));
var result = $('#responses-instanceConfigPut-501-schema-501');
result.empty();
result.append(view.render());
});
</script>
</div>
<input id='responses-instanceConfigPut-501-schema-data' type='hidden' value=''></input>
</div>
</div>
@ -26955,7 +27345,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2019-08-05T03:02:48.921+02:00
Generated 2019-08-05T18:13:15.915+02:00
</div>
</div>
</div>

View File

@ -731,7 +731,7 @@ SWGInstanceApi::instanceChannelsCallback(SWGHttpRequestWorker * worker) {
}
void
SWGInstanceApi::instanceConfig() {
SWGInstanceApi::instanceConfigGet() {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/config");
@ -751,13 +751,13 @@ SWGInstanceApi::instanceConfig() {
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGInstanceApi::instanceConfigCallback);
&SWGInstanceApi::instanceConfigGetCallback);
worker->execute(&input);
}
void
SWGInstanceApi::instanceConfigCallback(SWGHttpRequestWorker * worker) {
SWGInstanceApi::instanceConfigGetCallback(SWGHttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
@ -775,10 +775,65 @@ SWGInstanceApi::instanceConfigCallback(SWGHttpRequestWorker * worker) {
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit instanceConfigSignal(output);
emit instanceConfigGetSignal(output);
} else {
emit instanceConfigSignalE(output, error_type, error_str);
emit instanceConfigSignalEFull(worker, error_type, error_str);
emit instanceConfigGetSignalE(output, error_type, error_str);
emit instanceConfigGetSignalEFull(worker, error_type, error_str);
}
}
void
SWGInstanceApi::instanceConfigPut(SWGInstanceConfigResponse& body) {
QString fullPath;
fullPath.append(this->host).append(this->basePath).append("/sdrangel/config");
SWGHttpRequestWorker *worker = new SWGHttpRequestWorker();
SWGHttpRequestInput input(fullPath, "PUT");
QString output = body.asJson();
input.request_body.append(output);
foreach(QString key, this->defaultHeaders.keys()) {
input.headers.insert(key, this->defaultHeaders.value(key));
}
connect(worker,
&SWGHttpRequestWorker::on_execution_finished,
this,
&SWGInstanceApi::instanceConfigPutCallback);
worker->execute(&input);
}
void
SWGInstanceApi::instanceConfigPutCallback(SWGHttpRequestWorker * worker) {
QString msg;
QString error_str = worker->error_str;
QNetworkReply::NetworkError error_type = worker->error_type;
if (worker->error_type == QNetworkReply::NoError) {
msg = QString("Success! %1 bytes").arg(worker->response.length());
}
else {
msg = "Error: " + worker->error_str;
}
QString json(worker->response);
SWGSuccessResponse* output = static_cast<SWGSuccessResponse*>(create(json, QString("SWGSuccessResponse")));
worker->deleteLater();
if (worker->error_type == QNetworkReply::NoError) {
emit instanceConfigPutSignal(output);
} else {
emit instanceConfigPutSignalE(output, error_type, error_str);
emit instanceConfigPutSignalEFull(worker, error_type, error_str);
}
}

View File

@ -64,7 +64,8 @@ public:
void instanceAudioOutputDelete(SWGAudioOutputDevice& body);
void instanceAudioOutputPatch(SWGAudioOutputDevice& body);
void instanceChannels(qint32 direction);
void instanceConfig();
void instanceConfigGet();
void instanceConfigPut(SWGInstanceConfigResponse& body);
void instanceDelete();
void instanceDeviceSetsGet();
void instanceDevices(qint32 direction);
@ -95,7 +96,8 @@ private:
void instanceAudioOutputDeleteCallback (SWGHttpRequestWorker * worker);
void instanceAudioOutputPatchCallback (SWGHttpRequestWorker * worker);
void instanceChannelsCallback (SWGHttpRequestWorker * worker);
void instanceConfigCallback (SWGHttpRequestWorker * worker);
void instanceConfigGetCallback (SWGHttpRequestWorker * worker);
void instanceConfigPutCallback (SWGHttpRequestWorker * worker);
void instanceDeleteCallback (SWGHttpRequestWorker * worker);
void instanceDeviceSetsGetCallback (SWGHttpRequestWorker * worker);
void instanceDevicesCallback (SWGHttpRequestWorker * worker);
@ -126,7 +128,8 @@ signals:
void instanceAudioOutputDeleteSignal(SWGAudioOutputDevice* summary);
void instanceAudioOutputPatchSignal(SWGAudioOutputDevice* summary);
void instanceChannelsSignal(SWGInstanceChannelsResponse* summary);
void instanceConfigSignal(SWGInstanceConfigResponse* summary);
void instanceConfigGetSignal(SWGInstanceConfigResponse* summary);
void instanceConfigPutSignal(SWGSuccessResponse* summary);
void instanceDeleteSignal(SWGInstanceSummaryResponse* summary);
void instanceDeviceSetsGetSignal(SWGDeviceSetList* summary);
void instanceDevicesSignal(SWGInstanceDevicesResponse* summary);
@ -156,7 +159,8 @@ signals:
void instanceAudioOutputDeleteSignalE(SWGAudioOutputDevice* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceAudioOutputPatchSignalE(SWGAudioOutputDevice* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceChannelsSignalE(SWGInstanceChannelsResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceConfigSignalE(SWGInstanceConfigResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceConfigGetSignalE(SWGInstanceConfigResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceConfigPutSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceDeleteSignalE(SWGInstanceSummaryResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceDeviceSetsGetSignalE(SWGDeviceSetList* summary, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceDevicesSignalE(SWGInstanceDevicesResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str);
@ -186,7 +190,8 @@ signals:
void instanceAudioOutputDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceAudioOutputPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceChannelsSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceConfigSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceConfigGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceConfigPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceDeviceSetsGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);
void instanceDevicesSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str);