From 1bcecec1037329d5b2f1626012b77b6018387804 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 8 May 2022 19:33:10 +0200 Subject: [PATCH] v7: added API for configurations and updated presets API. Implements #1234 --- plugins/channelrx/chanalyzer/chanalyzer.cpp | 1 - .../vorlocalizer/vorlocalizerworker.cpp | 4 +- sdrbase/maincore.cpp | 3 + sdrbase/maincore.h | 63 + sdrbase/resources/webapi/doc/html2/index.html | 5146 ++++++++++++++++- .../resources/webapi/doc/swagger/swagger.yaml | 435 +- sdrbase/settings/mainsettings.cpp | 20 + sdrbase/settings/mainsettings.h | 4 + sdrbase/settings/preset.cpp | 13 + sdrbase/settings/preset.h | 1 + sdrbase/webapi/webapiadapter.cpp | 560 +- sdrbase/webapi/webapiadapter.h | 60 + sdrbase/webapi/webapiadapterinterface.cpp | 5 + sdrbase/webapi/webapiadapterinterface.h | 181 +- sdrbase/webapi/webapirequestmapper.cpp | 493 +- sdrbase/webapi/webapirequestmapper.h | 7 + sdrgui/mainwindow.cpp | 22 + sdrsrv/mainserver.cpp | 8 + swagger/sdrangel/api/swagger/swagger.yaml | 435 +- swagger/sdrangel/code/html2/index.html | 5146 ++++++++++++++++- .../code/qt5/client/SWGBase64Blob.cpp | 110 + .../sdrangel/code/qt5/client/SWGBase64Blob.h | 59 + .../code/qt5/client/SWGConfigurationGroup.cpp | 162 + .../code/qt5/client/SWGConfigurationGroup.h | 73 + .../qt5/client/SWGConfigurationIdentifier.cpp | 135 + .../qt5/client/SWGConfigurationIdentifier.h | 65 + .../client/SWGConfigurationImportExport.cpp | 135 + .../qt5/client/SWGConfigurationImportExport.h | 66 + .../code/qt5/client/SWGConfigurationItem.cpp | 110 + .../code/qt5/client/SWGConfigurationItem.h | 59 + .../code/qt5/client/SWGConfigurations.cpp | 137 + .../code/qt5/client/SWGConfigurations.h | 66 + .../sdrangel/code/qt5/client/SWGFilePath.cpp | 110 + .../sdrangel/code/qt5/client/SWGFilePath.h | 59 + .../code/qt5/client/SWGInstanceApi.cpp | 604 +- .../sdrangel/code/qt5/client/SWGInstanceApi.h | 63 +- .../code/qt5/client/SWGModelFactory.h | 42 + .../code/qt5/client/SWGPresetExport.h | 2 +- .../code/qt5/client/SWGPresetImport.cpp | 57 +- .../code/qt5/client/SWGPresetImport.h | 17 +- 40 files changed, 14602 insertions(+), 136 deletions(-) create mode 100644 swagger/sdrangel/code/qt5/client/SWGBase64Blob.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGBase64Blob.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationItem.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurationItem.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurations.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGConfigurations.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGFilePath.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGFilePath.h diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index 985ae81f7..b197902f3 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -117,7 +117,6 @@ int ChannelAnalyzer::getChannelSampleRate() m_basebandSampleRate = source->getSampleRate(); } - qDebug("ChannelAnalyzer::getChannelSampleRate: %d", m_basebandSampleRate); return m_basebandSampleRate; } diff --git a/plugins/feature/vorlocalizer/vorlocalizerworker.cpp b/plugins/feature/vorlocalizer/vorlocalizerworker.cpp index 0dc5f5621..2c2affb67 100644 --- a/plugins/feature/vorlocalizer/vorlocalizerworker.cpp +++ b/plugins/feature/vorlocalizer/vorlocalizerworker.cpp @@ -213,7 +213,7 @@ void VorLocalizerWorker::updateHardware() quint64 VorLocalizerWorker::getDeviceCenterFrequency(int deviceIndex) { std::vector deviceSets = MainCore::instance()->getDeviceSets(); - if (deviceIndex < deviceSets.size()) + if (deviceIndex < (int) deviceSets.size()) { DeviceSet *deviceSet = deviceSets[deviceIndex]; if (deviceSet->m_deviceSourceEngine) @@ -233,7 +233,7 @@ quint64 VorLocalizerWorker::getDeviceCenterFrequency(int deviceIndex) int VorLocalizerWorker::getDeviceSampleRate(int deviceIndex) { std::vector deviceSets = MainCore::instance()->getDeviceSets(); - if (deviceIndex < deviceSets.size()) + if (deviceIndex < (int) deviceSets.size()) { DeviceSet *deviceSet = deviceSets[deviceIndex]; if (deviceSet->m_deviceSourceEngine) diff --git a/sdrbase/maincore.cpp b/sdrbase/maincore.cpp index f504fdbba..363955e5f 100644 --- a/sdrbase/maincore.cpp +++ b/sdrbase/maincore.cpp @@ -35,6 +35,9 @@ MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteInstance, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgLoadPreset, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgSavePreset, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgDeletePreset, Message) +MESSAGE_CLASS_DEFINITION(MainCore::MsgLoadConfiguration, Message) +MESSAGE_CLASS_DEFINITION(MainCore::MsgSaveConfiguration, Message) +MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteConfiguration, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgLoadFeatureSetPreset, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgSaveFeatureSetPreset, Message) MESSAGE_CLASS_DEFINITION(MainCore::MsgDeleteFeatureSetPreset, Message) diff --git a/sdrbase/maincore.h b/sdrbase/maincore.h index 15a8ae5cc..464861f8e 100644 --- a/sdrbase/maincore.h +++ b/sdrbase/maincore.h @@ -167,6 +167,69 @@ public: { } }; + class SDRBASE_API MsgLoadConfiguration : public Message { + MESSAGE_CLASS_DECLARATION + + public: + const Configuration *getConfiguration() const { return m_configuration; } + + static MsgLoadConfiguration* create(const Configuration *configuration) + { + return new MsgLoadConfiguration(configuration); + } + + private: + const Configuration *m_configuration; + + MsgLoadConfiguration(const Configuration *configuration) : + Message(), + m_configuration(configuration) + { } + }; + + class SDRBASE_API MsgSaveConfiguration : public Message { + MESSAGE_CLASS_DECLARATION + + public: + Configuration *getConfiguration() const { return m_configuration; } + bool isNewConfiguration() const { return m_newConfiguration; } + + static MsgSaveConfiguration* create(Configuration *configuration, bool newConfiguration) + { + return new MsgSaveConfiguration(configuration, newConfiguration); + } + + private: + Configuration *m_configuration; + bool m_newConfiguration; + + MsgSaveConfiguration(Configuration *configuration, bool newConfiguration) : + Message(), + m_configuration(configuration), + m_newConfiguration(newConfiguration) + { } + }; + + class SDRBASE_API MsgDeleteConfiguration : public Message { + MESSAGE_CLASS_DECLARATION + + public: + const Configuration *getConfiguration() const { return m_configuration; } + + static MsgDeleteConfiguration* create(const Configuration *configuration) + { + return new MsgDeleteConfiguration(configuration); + } + + private: + const Configuration *m_configuration; + + MsgDeleteConfiguration(const Configuration *configuration) : + Message(), + m_configuration(configuration) + { } + }; + class SDRBASE_API MsgLoadFeatureSetPreset : public Message { MESSAGE_CLASS_DECLARATION diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index e764b24ef..3a117e943 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -2502,6 +2502,16 @@ margin-bottom: 20px; } }, "description" : "A bandwidth expressed in Hertz (Hz)" +}; + defs.Base64Blob = { + "required" : [ "blob" ], + "properties" : { + "blob" : { + "type" : "string", + "description" : "Blob in base64" + } + }, + "description" : "Binary blob in base64 format" }; defs.BeamSteeringCWModSettings = { "properties" : { @@ -4005,6 +4015,79 @@ margin-bottom: 20px; } }, "description" : "A complex number" +}; + defs.ConfigurationGroup = { + "required" : [ "groupName" ], + "properties" : { + "groupName" : { + "type" : "string", + "description" : "Name of the configuration group" + }, + "nbConfigurations" : { + "type" : "integer", + "description" : "Number of configurations in the group" + }, + "configurations" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ConfigurationItem" + } + } + }, + "description" : "Group of configuration" +}; + defs.ConfigurationIdentifier = { + "required" : [ "groupName", "name" ], + "properties" : { + "groupName" : { + "type" : "string", + "description" : "Name of the preset group" + }, + "name" : { + "type" : "string", + "description" : "Descriptive name of the preset" + } + }, + "description" : "Configuration item" +}; + defs.ConfigurationImportExport = { + "properties" : { + "filePath" : { + "type" : "string", + "description" : "Path of the import file" + }, + "configuration" : { + "description" : "On import new configuration details. On export configuration to export from", + "$ref" : "#/definitions/ConfigurationIdentifier" + } + }, + "description" : "Details to impprt/export a configuration from/to file" +}; + defs.ConfigurationItem = { + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "string", + "description" : "Descriptive name of the configuration" + } + }, + "description" : "Configuration preset item" +}; + defs.Configurations = { + "required" : [ "nbGroups" ], + "properties" : { + "nbGroups" : { + "type" : "integer", + "description" : "Number of configuration groups" + }, + "groups" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ConfigurationGroup" + } + } + }, + "description" : "Configuration presets" }; defs.DABDemodSettings = { "properties" : { @@ -5538,6 +5621,16 @@ margin-bottom: 20px; } }, "description" : "FileInput" +}; + defs.FilePath = { + "required" : [ "filePath" ], + "properties" : { + "filePath" : { + "type" : "string", + "description" : "File path" + } + }, + "description" : "File path" }; defs.FileSinkActions = { "properties" : { @@ -9811,13 +9904,14 @@ margin-bottom: 20px; "properties" : { "filePath" : { "type" : "string", - "description" : "Path of the import file" + "description" : "Path of the export file" }, "preset" : { + "description" : "Preset to export", "$ref" : "#/definitions/PresetIdentifier" } }, - "description" : "Details to export a preset to file" + "description" : "Details to export a preset to a file" }; defs.PresetGroup = { "required" : [ "groupName", "nbPresets" ], @@ -9865,20 +9959,16 @@ margin-bottom: 20px; defs.PresetImport = { "required" : [ "filePath" ], "properties" : { - "groupName" : { - "type" : "string", - "description" : "If present overrides imported preset group name with this name" - }, - "description" : { - "type" : "string", - "description" : "If present overrides imported preset description with this description" + "preset" : { + "description" : "New preset details", + "$ref" : "#/definitions/PresetIdentifier" }, "filePath" : { "type" : "string", "description" : "Path of the import file" } }, - "description" : "Details to import preset from file in preset list" + "description" : "Details to import new preset from file" }; defs.PresetItem = { "required" : [ "centerFrequency", "name", "type" ], @@ -14562,6 +14652,33 @@ margin-bottom: 20px;
  • instanceConfigPut
  • +
  • + instanceConfigurationBlobPost +
  • +
  • + instanceConfigurationBlobPut +
  • +
  • + instanceConfigurationDelete +
  • +
  • + instanceConfigurationFilePost +
  • +
  • + instanceConfigurationFilePut +
  • +
  • + instanceConfigurationPatch +
  • +
  • + instanceConfigurationPost +
  • +
  • + instanceConfigurationPut +
  • +
  • + instanceConfigurationsGet +
  • instanceDelete
  • @@ -14607,6 +14724,12 @@ margin-bottom: 20px;
  • instanceLoggingPut
  • +
  • + instancePresetBlobPost +
  • +
  • + instancePresetBlobPut +
  • instancePresetDelete
  • @@ -41446,6 +41569,4082 @@ $(document).ready(function() {
    +
    +
    +
    +

    instanceConfigurationBlobPost

    +

    +
    +
    +
    +

    +

    serialize a configuration to a base64 blob.

    +

    +
    +
    /sdrangel/configuration/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/configuration/blob"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | configuration identification
    +        try {
    +            Base64Blob result = apiInstance.instanceConfigurationBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | configuration identification
    +        try {
    +            Base64Blob result = apiInstance.instanceConfigurationBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // configuration identification
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationBlobPostWith:body
    +              completionHandler: ^(Base64Blob output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} configuration identification
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationBlobPost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationBlobPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | configuration identification
    +
    +            try
    +            {
    +                Base64Blob result = apiInstance.instanceConfigurationBlobPost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationBlobPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | configuration identification
    +
    +try {
    +    $result = $api_instance->instanceConfigurationBlobPost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationBlobPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | configuration identification
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationBlobPost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationBlobPost: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | configuration identification
    +
    +try: 
    +    api_response = api_instance.instance_configuration_blob_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationBlobPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return blob

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Preset not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationBlobPut

    +

    +
    +
    +
    +

    +

    deserialize base64 blob to a new configuration.

    +

    +
    +
    /sdrangel/configuration/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/configuration/blob"
    +
    +
    +
    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();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Base64Blob *body = ; // Blob in base64 format
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationBlobPutWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {Base64Blob} Blob in base64 format
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationBlobPut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationBlobPutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new Base64Blob(); // Base64Blob | Blob in base64 format
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationBlobPut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationBlobPut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // Base64Blob | Blob in base64 format
    +
    +try {
    +    $result = $api_instance->instanceConfigurationBlobPut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationBlobPut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::Base64Blob->new(); # Base64Blob | Blob in base64 format
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationBlobPut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationBlobPut: $@\n";
    +}
    +
    + +
    +
    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 =  # Base64Blob | Blob in base64 format
    +
    +try: 
    +    api_response = api_instance.instance_configuration_blob_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationBlobPut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return configuration identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationDelete

    +

    +
    +
    +
    +

    +

    Deletes a configuration

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | delete this configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationDelete(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationDelete");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | delete this configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationDelete(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationDelete");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // delete this configuration
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationDeleteWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} delete this configuration
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationDelete(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationDeleteExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | delete this configuration
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationDelete(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationDelete: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | delete this configuration
    +
    +try {
    +    $result = $api_instance->instanceConfigurationDelete($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationDelete: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | delete this configuration
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationDelete(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationDelete: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | delete this configuration
    +
    +try: 
    +    api_response = api_instance.instance_configuration_delete(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationDelete: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the selected configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Configuration not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationFilePost

    +

    +
    +
    +
    +

    +

    export a configuration to file.

    +

    +
    +
    /sdrangel/configuration/file
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/configuration/file"
    +
    +
    +
    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();
    +        ConfigurationImportExport body = ; // ConfigurationImportExport | export details
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationImportExport body = ; // ConfigurationImportExport | export details
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationImportExport *body = ; // export details
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationFilePostWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationImportExport} export details
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationFilePost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationFilePostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationImportExport(); // ConfigurationImportExport | export details
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationFilePost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationImportExport | export details
    +
    +try {
    +    $result = $api_instance->instanceConfigurationFilePost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationFilePost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationImportExport->new(); # ConfigurationImportExport | export details
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationFilePost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationFilePost: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationImportExport | export details
    +
    +try: 
    +    api_response = api_instance.instance_configuration_file_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationFilePost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return configuration identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Configuration or file path not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationFilePut

    +

    +
    +
    +
    +

    +

    import a configuration from file as a new configuration.

    +

    +
    +
    /sdrangel/configuration/file
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/configuration/file"
    +
    +
    +
    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();
    +        FilePath body = ; // FilePath | File path
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        FilePath body = ; // FilePath | File path
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    FilePath *body = ; // File path
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationFilePutWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {FilePath} File path
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationFilePut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationFilePutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new FilePath(); // FilePath | File path
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationFilePut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // FilePath | File path
    +
    +try {
    +    $result = $api_instance->instanceConfigurationFilePut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationFilePut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::FilePath->new(); # FilePath | File path
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationFilePut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationFilePut: $@\n";
    +}
    +
    + +
    +
    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 =  # FilePath | File path
    +
    +try: 
    +    api_response = api_instance.instance_configuration_file_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationFilePut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return configuration identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - File not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationPatch

    +

    +
    +
    +
    +

    +

    Load a configuration

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PATCH "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | Load configuration settings
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPatch(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPatch");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | Load configuration settings
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPatch(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPatch");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // Load configuration settings
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationPatchWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} Load configuration settings
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationPatch(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationPatchExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | Load configuration settings
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationPatch(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationPatch: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | Load configuration settings
    +
    +try {
    +    $result = $api_instance->instanceConfigurationPatch($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationPatch: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | Load configuration settings
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationPatch(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationPatch: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | Load configuration settings
    +
    +try: 
    +    api_response = api_instance.instance_configuration_patch(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationPatch: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the selected configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - No configuration found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationPost

    +

    +
    +
    +
    +

    +

    Create a new configuration from the current setup.

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup in a new configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup in a new configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // save setup in a new configuration
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationPostWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} save setup in a new configuration
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationPost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | save setup in a new configuration
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationPost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | save setup in a new configuration
    +
    +try {
    +    $result = $api_instance->instanceConfigurationPost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | save setup in a new configuration
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationPost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationPost: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | save setup in a new configuration
    +
    +try: 
    +    api_response = api_instance.instance_configuration_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the created configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 409 - Configuration already exists

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationPut

    +

    +
    +
    +
    +

    +

    Update an existing configuration with current setup.

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup to the configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup to the configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // save setup to the configuration
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationPutWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} save setup to the configuration
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationPut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationPutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | save setup to the configuration
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationPut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationPut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | save setup to the configuration
    +
    +try {
    +    $result = $api_instance->instanceConfigurationPut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationPut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | save setup to the configuration
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationPut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationPut: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | save setup to the configuration
    +
    +try: 
    +    api_response = api_instance.instance_configuration_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationPut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the selected configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - No configuration found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationsGet

    +

    +
    +
    +
    +

    +

    List all configurations in the instance

    +

    +
    +
    /sdrangel/configurations
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost/sdrangel/configurations"
    +
    +
    +
    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();
    +        try {
    +            Configurations result = apiInstance.instanceConfigurationsGet();
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationsGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        try {
    +            Configurations result = apiInstance.instanceConfigurationsGet();
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationsGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationsGetWithCompletionHandler: 
    +              ^(Configurations output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationsGet(callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationsGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +
    +            try
    +            {
    +                Configurations result = apiInstance.instanceConfigurationsGet();
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationsGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +
    +try {
    +    $result = $api_instance->instanceConfigurationsGet();
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationsGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationsGet();
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationsGet: $@\n";
    +}
    +
    + +
    +
    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()
    +
    +try: 
    +    api_response = api_instance.instance_configurations_get()
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationsGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + + + + +

    Responses

    +

    Status: 200 - On success return configurations list

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    @@ -47158,6 +51357,909 @@ $(document).ready(function() {

    +
    +
    +
    +

    instancePresetBlobPost

    +

    +
    +
    +
    +

    +

    serialize a preset to a base64 blob.

    +

    +
    +
    /sdrangel/preset/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/preset/blob"
    +
    +
    +
    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();
    +        PresetIdentifier body = ; // PresetIdentifier | Preset identification
    +        try {
    +            Base64Blob result = apiInstance.instancePresetBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        PresetIdentifier body = ; // PresetIdentifier | Preset identification
    +        try {
    +            Base64Blob result = apiInstance.instancePresetBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    PresetIdentifier *body = ; // Preset identification
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instancePresetBlobPostWith:body
    +              completionHandler: ^(Base64Blob output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {PresetIdentifier} Preset identification
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instancePresetBlobPost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instancePresetBlobPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new PresetIdentifier(); // PresetIdentifier | Preset identification
    +
    +            try
    +            {
    +                Base64Blob result = apiInstance.instancePresetBlobPost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instancePresetBlobPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // PresetIdentifier | Preset identification
    +
    +try {
    +    $result = $api_instance->instancePresetBlobPost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instancePresetBlobPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::PresetIdentifier->new(); # PresetIdentifier | Preset identification
    +
    +eval { 
    +    my $result = $api_instance->instancePresetBlobPost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instancePresetBlobPost: $@\n";
    +}
    +
    + +
    +
    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 =  # PresetIdentifier | Preset identification
    +
    +try: 
    +    api_response = api_instance.instance_preset_blob_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instancePresetBlobPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return blob

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Preset not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instancePresetBlobPut

    +

    +
    +
    +
    +

    +

    deserialize base64 blob to a new preset.

    +

    +
    +
    /sdrangel/preset/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/preset/blob"
    +
    +
    +
    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();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            PresetIdentifier result = apiInstance.instancePresetBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            PresetIdentifier result = apiInstance.instancePresetBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Base64Blob *body = ; // Blob in base64 format
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instancePresetBlobPutWith:body
    +              completionHandler: ^(PresetIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {Base64Blob} Blob in base64 format
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instancePresetBlobPut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instancePresetBlobPutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new Base64Blob(); // Base64Blob | Blob in base64 format
    +
    +            try
    +            {
    +                PresetIdentifier result = apiInstance.instancePresetBlobPut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instancePresetBlobPut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // Base64Blob | Blob in base64 format
    +
    +try {
    +    $result = $api_instance->instancePresetBlobPut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instancePresetBlobPut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::Base64Blob->new(); # Base64Blob | Blob in base64 format
    +
    +eval { 
    +    my $result = $api_instance->instancePresetBlobPut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instancePresetBlobPut: $@\n";
    +}
    +
    + +
    +
    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 =  # Base64Blob | Blob in base64 format
    +
    +try: 
    +    api_response = api_instance.instance_preset_blob_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instancePresetBlobPut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return preset identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    @@ -48113,7 +53215,7 @@ $(document).ready(function() {

    -

    import a preset from file as a new preset (server only).

    +

    import a preset from file as a new preset.


    /sdrangel/preset/file
    @@ -48152,7 +53254,7 @@ public class InstanceApiExample { public static void main(String[] args) { InstanceApi apiInstance = new InstanceApi(); - PresetImport body = ; // PresetImport | import details + FilePath body = ; // FilePath | File path try { PresetIdentifier result = apiInstance.instancePresetFilePut(body); System.out.println(result); @@ -48171,7 +53273,7 @@ public class InstanceApiExample { public static void main(String[] args) { InstanceApi apiInstance = new InstanceApi(); - PresetImport body = ; // PresetImport | import details + FilePath body = ; // FilePath | File path try { PresetIdentifier result = apiInstance.instancePresetFilePut(body); System.out.println(result); @@ -48187,7 +53289,7 @@ public class InstanceApiExample {
    Coming Soon!
    -->
    -
    PresetImport *body = ; // import details
    +                              
    FilePath *body = ; // File path
     
     InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
    @@ -48208,7 +53310,7 @@ InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
     var api = new SdRangel.InstanceApi()
     
    -var body = ; // {PresetImport} import details
    +var body = ; // {FilePath} File path
     
     
     var callback = function(error, data, response) {
    @@ -48240,7 +53342,7 @@ namespace Example
             {
                 
                 var apiInstance = new InstanceApi();
    -            var body = new PresetImport(); // PresetImport | import details
    +            var body = new FilePath(); // FilePath | File path
     
                 try
                 {
    @@ -48262,7 +53364,7 @@ namespace Example
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // PresetImport | import details
    +$body = ; // FilePath | File path
     
     try {
         $result = $api_instance->instancePresetFilePut($body);
    @@ -48279,7 +53381,7 @@ use SWGSDRangel::Configuration;
     use SWGSDRangel::InstanceApi;
     
     my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::PresetImport->new(); # PresetImport | import details
    +my $body = SWGSDRangel::Object::FilePath->new(); # FilePath | File path
     
     eval { 
         my $result = $api_instance->instancePresetFilePut(body => $body);
    @@ -48299,7 +53401,7 @@ from pprint import pprint
     
     # create an instance of the API class
     api_instance = swagger_sdrangel.InstanceApi()
    -body =  # PresetImport | import details
    +body =  # FilePath | File path
     
     try: 
         api_response = api_instance.instance_preset_file_put(body)
    @@ -48328,10 +53430,10 @@ $(document).ready(function() {
       var schemaWrapper = {
       "in" : "body",
       "name" : "body",
    -  "description" : "import details",
    +  "description" : "File path",
       "required" : true,
       "schema" : {
    -    "$ref" : "#/definitions/PresetImport"
    +    "$ref" : "#/definitions/FilePath"
       }
     };
       var schema = schemaWrapper.schema;
    @@ -50723,7 +55825,7 @@ except ApiException as e:
               
    - Generated 2022-05-04T08:35:39.790+02:00 + Generated 2022-05-08T19:09:57.985+02:00
    diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index d8bad10c0..f03bcf827 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -821,7 +821,7 @@ paths: /sdrangel/preset/file: x-swagger-router-controller: instance put: - description: import a preset from file as a new preset (server only). + description: import a preset from file as a new preset. operationId: instancePresetFilePut tags: - Instance @@ -830,10 +830,10 @@ paths: parameters: - name: body in: body - description: import details + description: File path required: true schema: - $ref: "#/definitions/PresetImport" + $ref: "#/definitions/FilePath" responses: "200": description: On success return preset identification @@ -883,6 +883,337 @@ paths: "501": $ref: "#/responses/Response_501" + /sdrangel/preset/blob: + x-swagger-router-controller: instance + put: + description: deserialize base64 blob to a new preset. + operationId: instancePresetBlobPut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Blob in base64 format + required: true + schema: + $ref: "#/definitions/Base64Blob" + responses: + "200": + description: On success return preset identification + schema: + $ref: "#/definitions/PresetIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: serialize a preset to a base64 blob. + operationId: instancePresetBlobPost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Preset identification + required: true + schema: + $ref: "#/definitions/PresetIdentifier" + responses: + "200": + description: On success return blob + schema: + $ref: "#/definitions/Base64Blob" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Preset not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configurations: + x-swagger-router-controller: instance + get: + description: List all configurations in the instance + operationId: instanceConfigurationsGet + tags: + - Instance + responses: + "200": + description: On success return configurations list + schema: + $ref: "#/definitions/Configurations" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configuration: + x-swagger-router-controller: instance + patch: + description: Load a configuration + operationId: instanceConfigurationPatch + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Load configuration settings + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the selected configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: No configuration found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + put: + description: Update an existing configuration with current setup. + operationId: instanceConfigurationPut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: save setup to the configuration + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the selected configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: No configuration found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: Create a new configuration from the current setup. + operationId: instanceConfigurationPost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: save setup in a new configuration + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the created configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "409": + description: Configuration already exists + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + delete: + description: Deletes a configuration + operationId: instanceConfigurationDelete + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: delete this configuration + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the selected configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Configuration not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configuration/file: + x-swagger-router-controller: instance + put: + description: import a configuration from file as a new configuration. + operationId: instanceConfigurationFilePut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: File path + required: true + schema: + $ref: "#/definitions/FilePath" + responses: + "200": + description: On success return configuration identification + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: File not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: export a configuration to file. + operationId: instanceConfigurationFilePost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: export details + required: true + schema: + $ref: "#/definitions/ConfigurationImportExport" + responses: + "200": + description: On success return configuration identification + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Configuration or file path not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configuration/blob: + x-swagger-router-controller: instance + put: + description: deserialize base64 blob to a new configuration. + operationId: instanceConfigurationBlobPut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Blob in base64 format + required: true + schema: + $ref: "#/definitions/Base64Blob" + responses: + "200": + description: On success return configuration identification + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: serialize a configuration to a base64 blob. + operationId: instanceConfigurationBlobPost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: configuration identification + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "200": + description: On success return blob + schema: + $ref: "#/definitions/Base64Blob" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Preset not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + /sdrangel/featurepresets: x-swagger-router-controller: instance get: @@ -3034,28 +3365,106 @@ definitions: $ref: "#/definitions/PresetIdentifier" PresetImport: - description: "Details to import preset from file in preset list" + description: "Details to import new preset from file" required: - filePath properties: - groupName: - description: "If present overrides imported preset group name with this name" - type: string - description: - description: "If present overrides imported preset description with this description" - type: string + preset: + description: "New preset details" + $ref: "#/definitions/PresetIdentifier" filePath: description: "Path of the import file" type: string PresetExport: - description: "Details to export a preset to file" + description: "Details to export a preset to a file" + properties: + filePath: + description: "Path of the export file" + type: string + preset: + description: "Preset to export" + $ref: "#/definitions/PresetIdentifier" + + Base64Blob: + description: "Binary blob in base64 format" + required: + - blob + properties: + blob: + description: "Blob in base64" + type: string + + FilePath: + description: "File path" + required: + - filePath + properties: + filePath: + description: "File path" + type: string + + Configurations: + description: "Configuration presets" + required: + - nbGroups + properties: + nbGroups: + description: "Number of configuration groups" + type: integer + groups: + type: array + items: + $ref: "#/definitions/ConfigurationGroup" + + ConfigurationGroup: + description: "Group of configuration" + required: + - groupName + - nbPresets + properties: + groupName: + description: "Name of the configuration group" + type: string + nbConfigurations: + description: "Number of configurations in the group" + type: integer + configurations: + type: array + items: + $ref: "#/definitions/ConfigurationItem" + + ConfigurationIdentifier: + description: "Configuration item" + required: + - groupName + - name + properties: + groupName: + description: "Name of the preset group" + type: string + name: + description: "Descriptive name of the preset" + type: string + + ConfigurationItem: + description: "Configuration preset item" + required: + - name + properties: + name: + description: "Descriptive name of the configuration" + type: string + + ConfigurationImportExport: + description: "Details to impprt/export a configuration from/to file" properties: filePath: description: "Path of the import file" type: string - preset: - $ref: "#/definitions/PresetIdentifier" + configuration: + description: "On import new configuration details. On export configuration to export from" + $ref: "#/definitions/ConfigurationIdentifier" FeaturePresets: description: "Feature settings presets" diff --git a/sdrbase/settings/mainsettings.cpp b/sdrbase/settings/mainsettings.cpp index 85d2dbdd7..e9529066f 100644 --- a/sdrbase/settings/mainsettings.cpp +++ b/sdrbase/settings/mainsettings.cpp @@ -238,6 +238,16 @@ void MainSettings::deletePreset(const Preset* preset) delete (Preset*)preset; } +QByteArray MainSettings::serializePreset(const Preset* preset) const +{ + return preset->serialize(); +} + +bool MainSettings::deserializePreset(const QByteArray& blob, Preset* preset) +{ + return preset->deserialize(blob); +} + void MainSettings::deletePresetGroup(const QString& groupName) { Presets::iterator it = m_presets.begin(); @@ -476,6 +486,16 @@ void MainSettings::deleteConfiguration(const Configuration *configuration) delete (Configuration*) configuration; } +QByteArray MainSettings::serializeConfiguration(const Configuration *configuration) const +{ + return configuration->serialize(); +} + +bool MainSettings::deserializeConfiguration(const QByteArray& blob, Configuration *configuration) +{ + return configuration->deserialize(blob); +} + const Configuration* MainSettings::getConfiguration(const QString& groupName, const QString& description) const { int nbConfigurations = getConfigurationCount(); diff --git a/sdrbase/settings/mainsettings.h b/sdrbase/settings/mainsettings.h index 9c94b0392..5e55e2f92 100644 --- a/sdrbase/settings/mainsettings.h +++ b/sdrbase/settings/mainsettings.h @@ -37,6 +37,8 @@ public: Preset* newPreset(const QString& group, const QString& description); void addPreset(Preset *preset); void deletePreset(const Preset* preset); + QByteArray serializePreset(const Preset* preset) const; + bool deserializePreset(const QByteArray& blob, Preset* preset); int getPresetCount() const { return m_presets.count(); } const Preset* getPreset(int index) const { return m_presets[index]; } const Preset* getPreset(const QString& groupName, quint64 centerFrequency, const QString& description, const QString& type) const; @@ -75,6 +77,8 @@ public: Configuration* newConfiguration(const QString& group, const QString& description); void addConfiguration(Configuration *configuration); void deleteConfiguration(const Configuration *configuration); + QByteArray serializeConfiguration(const Configuration *configuration) const; + bool deserializeConfiguration(const QByteArray& blob, Configuration *configuration); int getConfigurationCount() const { return m_configurations.size(); } const Configuration* getConfiguration(int index) const { return m_configurations[index]; } const Configuration* getConfiguration(const QString& groupName, const QString& description) const; diff --git a/sdrbase/settings/preset.cpp b/sdrbase/settings/preset.cpp index 4cb5b598a..105858c61 100644 --- a/sdrbase/settings/preset.cpp +++ b/sdrbase/settings/preset.cpp @@ -407,3 +407,16 @@ const QByteArray* Preset::findBestDeviceConfigSoapy(const QString& sourceId, con return &(it->m_config); } } + +QString Preset::getPresetTypeChar(PresetType presetType) +{ + if (presetType == PresetSource) { + return "R"; + } else if (presetType == PresetSink) { + return "T"; + } else if (presetType == PresetMIMO) { + return "M"; + } else { + return "X"; + } +} diff --git a/sdrbase/settings/preset.h b/sdrbase/settings/preset.h index edf306d7e..be217c7b9 100644 --- a/sdrbase/settings/preset.h +++ b/sdrbase/settings/preset.h @@ -89,6 +89,7 @@ public: bool isMIMOPreset() const { return m_presetType == PresetMIMO; } PresetType getPresetType() const { return m_presetType; } void setPresetType(PresetType presetType) { m_presetType = presetType; } + static QString getPresetTypeChar(PresetType presetType); QByteArray serialize() const; bool deserialize(const QByteArray& data); diff --git a/sdrbase/webapi/webapiadapter.cpp b/sdrbase/webapi/webapiadapter.cpp index 4593a88be..2d4ded98d 100644 --- a/sdrbase/webapi/webapiadapter.cpp +++ b/sdrbase/webapi/webapiadapter.cpp @@ -57,6 +57,12 @@ #include "SWGPresetItem.h" #include "SWGPresetTransfer.h" #include "SWGPresetIdentifier.h" +#include "SWGPresetExport.h" +#include "SWGConfigurations.h" +#include "SWGConfigurationIdentifier.h" +#include "SWGConfigurationImportExport.h" +#include "SWGBase64Blob.h" +#include "SWGFilePath.h" #include "SWGDeviceSettings.h" #include "SWGDeviceState.h" #include "SWGDeviceReport.h" @@ -1169,7 +1175,7 @@ int WebAPIAdapter::instancePresetsGet( swgPresets->append(new SWGSDRangel::SWGPresetItem); swgPresets->back()->init(); swgPresets->back()->setCenterFrequency(preset->getCenterFrequency()); - *swgPresets->back()->getType() = preset->isSourcePreset() ? "R" : preset->isSinkPreset() ? "T" : preset->isMIMOPreset() ? "M" : "X"; + *swgPresets->back()->getType() = Preset::getPresetTypeChar(preset->getPresetType()); *swgPresets->back()->getName() = preset->getDescription(); nbPresetsThisGroup++; } @@ -1241,7 +1247,7 @@ int WebAPIAdapter::instancePresetPatch( response.init(); response.setCenterFrequency(selectedPreset->getCenterFrequency()); *response.getGroupName() = selectedPreset->getGroup(); - *response.getType() = selectedPreset->isSourcePreset() ? "R" : selectedPreset->isSinkPreset() ? "T" : selectedPreset->isMIMOPreset() ? "M" : "X"; + *response.getType() = Preset::getPresetTypeChar(selectedPreset->getPresetType()); *response.getName() = selectedPreset->getDescription(); return 202; @@ -1310,7 +1316,7 @@ int WebAPIAdapter::instancePresetPut( response.init(); response.setCenterFrequency(selectedPreset->getCenterFrequency()); *response.getGroupName() = selectedPreset->getGroup(); - *response.getType() = selectedPreset->isSourcePreset() ? "R" : selectedPreset->isSinkPreset() ? "T": selectedPreset->isMIMOPreset() ? "M" : "X"; + *response.getType() = Preset::getPresetTypeChar(selectedPreset->getPresetType()); *response.getName() = selectedPreset->getDescription(); return 202; @@ -1373,7 +1379,7 @@ int WebAPIAdapter::instancePresetPost( response.init(); response.setCenterFrequency(selectedPreset->getCenterFrequency()); *response.getGroupName() = selectedPreset->getGroup(); - *response.getType() = selectedPreset->isSourcePreset() ? "R" : selectedPreset->isSinkPreset() ? "T" : selectedPreset->isMIMOPreset() ? "M" : "X"; + *response.getType() = Preset::getPresetTypeChar(selectedPreset->getPresetType()); *response.getName() = selectedPreset->getDescription(); return 202; @@ -1390,6 +1396,7 @@ int WebAPIAdapter::instancePresetDelete( if (selectedPreset == 0) { + error.init(); *error.getMessage() = QString("There is no preset [%1, %2, %3 %4]") .arg(*response.getGroupName()) .arg(response.getCenterFrequency()) @@ -1400,7 +1407,7 @@ int WebAPIAdapter::instancePresetDelete( response.setCenterFrequency(selectedPreset->getCenterFrequency()); *response.getGroupName() = selectedPreset->getGroup(); - *response.getType() = selectedPreset->isSourcePreset() ? "R" : selectedPreset->isSinkPreset() ? "T" : selectedPreset->isMIMOPreset() ? "M" : "X"; + *response.getType() = Preset::getPresetTypeChar(selectedPreset->getPresetType()); *response.getName() = selectedPreset->getDescription(); MainCore::MsgDeletePreset *msg = MainCore::MsgDeletePreset::create(const_cast(selectedPreset)); @@ -1409,6 +1416,549 @@ int WebAPIAdapter::instancePresetDelete( return 202; } +int WebAPIAdapter::instancePresetFilePut( + SWGSDRangel::SWGFilePath& query, + SWGSDRangel::SWGPresetIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + QString filePath = *query.getFilePath(); + + if (QFileInfo::exists(filePath)) + { + QFile file(filePath); + + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + QByteArray base64Str; + QTextStream instream(&file); + instream >> base64Str; + file.close(); + Preset *newPreset = m_mainCore->m_settings.newPreset("TBD", "TBD"); + + if (newPreset->deserialize(QByteArray::fromBase64(base64Str))) + { + response.init(); + *response.getGroupName() = newPreset->getGroup(); + response.setCenterFrequency(newPreset->getCenterFrequency()); + *response.getName() = newPreset->getDescription(); + *response.getType() = Preset::getPresetTypeChar(newPreset->getPresetType()); + return 202; + } + else + { + error.init(); + *error.getMessage() = QString("Cannot deserialize preset from file %1").arg(filePath); + return 400; + } + } + else + { + error.init(); + *error.getMessage() = QString("Cannot read file %1").arg(filePath); + return 500; + } + } + else + { + error.init(); + *error.getMessage() = QString("File %1 is not found").arg(filePath); + return 404; + } +} + +int WebAPIAdapter::instancePresetFilePost( + SWGSDRangel::SWGPresetExport& query, + SWGSDRangel::SWGPresetIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + QString filePath = *query.getFilePath(); + + if (QFileInfo(filePath).absoluteDir().exists()) + { + SWGSDRangel::SWGPresetIdentifier *presetId = query.getPreset(); + const Preset *selectedPreset = m_mainCore->m_settings.getPreset( + *presetId->getGroupName(), + presetId->getCenterFrequency(), + *presetId->getName(), + *presetId->getType()); + + if (selectedPreset) + { + QString base64Str = selectedPreset->serialize().toBase64(); + QFileInfo fileInfo(filePath); + + if (fileInfo.suffix() != "prex") { + filePath += ".prex"; + } + + QFile file(filePath); + + if (file.open(QIODevice::ReadWrite | QIODevice::Text)) + { + QTextStream outstream(&file); + outstream << base64Str; + file.close(); + response.init(); + *response.getGroupName() = selectedPreset->getGroup(); + response.setCenterFrequency(selectedPreset->getCenterFrequency()); + *response.getName() = selectedPreset->getDescription(); + *response.getType() = Preset::getPresetTypeChar(selectedPreset->getPresetType()); + return 200; + } + else + { + error.init(); + *error.getMessage() = QString("Cannot open %1 for writing").arg(filePath); + return 500; + } + } + else + { + error.init(); + *error.getMessage() = QString("There is no preset [%1, %2, %3, %4]") + .arg(*presetId->getGroupName()) + .arg(presetId->getCenterFrequency()) + .arg(*presetId->getName()) + .arg(*presetId->getType()); + return 404; + } + } + else + { + error.init(); + *error.getMessage() = QString("File %1 directory does not exist").arg(filePath); + return 404; + } +} + +int WebAPIAdapter::instancePresetBlobPut( + SWGSDRangel::SWGBase64Blob& query, + SWGSDRangel::SWGPresetIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + QString *base64Str = query.getBlob(); + + if (base64Str) + { + Preset *newPreset = m_mainCore->m_settings.newPreset("TBD", "TBD"); + + if (newPreset) + { + QByteArray blob = QByteArray::fromBase64(base64Str->toUtf8()); + + if (newPreset->deserialize(blob)) + { + response.init(); + *response.getGroupName() = newPreset->getGroup(); + response.setCenterFrequency(newPreset->getCenterFrequency()); + *response.getName() = newPreset->getDescription(); + *response.getType() = Preset::getPresetTypeChar(newPreset->getPresetType()); + return 202; + } + else + { + m_mainCore->m_settings.deletePreset(newPreset); + error.init(); + *error.getMessage() = QString("Could not deserialize blob to preset"); + return 400; + } + } + else + { + error.init(); + *error.getMessage() = QString("Cannot create new preset"); + return 500; + } + } + else + { + error.init(); + *error.getMessage() = QString("Blob not specified"); + return 400; + } +} + +int WebAPIAdapter::instancePresetBlobPost( + SWGSDRangel::SWGPresetIdentifier& query, + SWGSDRangel::SWGBase64Blob& response, + SWGSDRangel::SWGErrorResponse& error) +{ + const Preset *selectedPreset = m_mainCore->m_settings.getPreset( + *query.getGroupName(), + query.getCenterFrequency(), + *query.getName(), + *query.getType()); + + if (selectedPreset) + { + QString base64Str = selectedPreset->serialize().toBase64(); + response.init(); + *response.getBlob() = base64Str; + return 200; + } + else + { + error.init(); + *error.getMessage() = QString("There is no preset [%1, %2, %3, %4]") + .arg(*query.getGroupName()) + .arg(query.getCenterFrequency()) + .arg(*query.getName()) + .arg(*query.getType()); + return 404; + } +} + +int WebAPIAdapter::instanceConfigurationsGet( + SWGSDRangel::SWGConfigurations& response, + SWGSDRangel::SWGErrorResponse& error) +{ + (void) error; + int nbConfigurations = m_mainCore->m_settings.getConfigurationCount(); + int nbGroups = 0; + int nbConfigurationsThisGroup = 0; + QString groupName; + response.init(); + QList *groups = response.getGroups(); + QList *swgConfigurations = nullptr; + int i = 0; + + // Configurations are sorted by group first + + for (; i < nbConfigurations; i++) + { + const Configuration *configuration = m_mainCore->m_settings.getConfiguration(i); + + if ((i == 0) || (groupName != configuration->getGroup())) // new group + { + if (i > 0) { + groups->back()->setNbConfigurations(nbConfigurationsThisGroup); + } + + groups->append(new SWGSDRangel::SWGConfigurationGroup); + groups->back()->init(); + groupName = configuration->getGroup(); + *groups->back()->getGroupName() = groupName; + swgConfigurations = groups->back()->getConfigurations(); + nbGroups++; + nbConfigurationsThisGroup = 0; + } + + swgConfigurations->append(new SWGSDRangel::SWGConfigurationItem); + swgConfigurations->back()->init(); + *swgConfigurations->back()->getName() = configuration->getDescription(); + nbConfigurationsThisGroup++; + } + + if (i > 0) { + groups->back()->setNbConfigurations(nbConfigurationsThisGroup); + } + + response.setNbGroups(nbGroups); + + return 200; +} + +int WebAPIAdapter::instanceConfigurationPatch( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + SWGSDRangel::SWGConfigurationIdentifier *configurationIdentifier = &response; + + const Configuration *selectedConfiguration = m_mainCore->m_settings.getConfiguration( + *configurationIdentifier->getGroupName(), + *configurationIdentifier->getName() + ); + + if (selectedConfiguration == nullptr) + { + error.init(); + *error.getMessage() = QString("There is no configuration [%1, %2]") + .arg(*configurationIdentifier->getGroupName()) + .arg(*configurationIdentifier->getName()); + return 404; + } + + MainCore::MsgLoadConfiguration *msg = MainCore::MsgLoadConfiguration::create(selectedConfiguration); + m_mainCore->m_mainMessageQueue->push(msg); + + response.init(); + *response.getGroupName() = selectedConfiguration->getGroup(); + *response.getName() = selectedConfiguration->getDescription(); + + return 202; +} + +int WebAPIAdapter::instanceConfigurationPut( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + SWGSDRangel::SWGConfigurationIdentifier *configurationIdentifier = &response; + + const Configuration *selectedConfiguration = m_mainCore->m_settings.getConfiguration( + *configurationIdentifier->getGroupName(), + *configurationIdentifier->getName() + ); + + if (selectedConfiguration == nullptr) + { + error.init(); + *error.getMessage() = QString("There is no configuration [%1, %2]") + .arg(*configurationIdentifier->getGroupName()) + .arg(*configurationIdentifier->getName()); + return 404; + } + + MainCore::MsgSaveConfiguration *msg = MainCore::MsgSaveConfiguration::create(const_cast(selectedConfiguration), false); + m_mainCore->m_mainMessageQueue->push(msg); + + response.init(); + *response.getGroupName() = selectedConfiguration->getGroup(); + *response.getName() = selectedConfiguration->getDescription(); + + return 202; +} + +int WebAPIAdapter::instanceConfigurationPost( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + SWGSDRangel::SWGConfigurationIdentifier *configurationIdentifier = &response; + + const Configuration *selectedConfiguration = m_mainCore->m_settings.getConfiguration( + *configurationIdentifier->getGroupName(), + *configurationIdentifier->getName() + ); + + if (selectedConfiguration == nullptr) // save on a new preset + { + selectedConfiguration = m_mainCore->m_settings.newConfiguration( + *configurationIdentifier->getGroupName(), + *configurationIdentifier->getName() + ); + } + else + { + error.init(); + *error.getMessage() = QString("Preset already exists [%1, %2]") + .arg(*configurationIdentifier->getGroupName()) + .arg(*configurationIdentifier->getName()); + return 409; + } + + MainCore::MsgSaveConfiguration *msg = MainCore::MsgSaveConfiguration::create(const_cast(selectedConfiguration), true); + m_mainCore->m_mainMessageQueue->push(msg); + + response.init(); + *response.getGroupName() = selectedConfiguration->getGroup(); + *response.getName() = selectedConfiguration->getDescription(); + + return 202; +} + +int WebAPIAdapter::instanceConfigurationDelete( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + const Configuration *selectedConfiguration = m_mainCore->m_settings.getConfiguration( + *response.getGroupName(), + *response.getName()); + + if (selectedConfiguration == nullptr) + { + error.init(); + *error.getMessage() = QString("There is no configuration [%1, %2]") + .arg(*response.getGroupName()) + .arg(*response.getName()); + return 404; + } + + *response.getGroupName() = selectedConfiguration->getGroup(); + *response.getName() = selectedConfiguration->getDescription(); + + MainCore::MsgDeleteConfiguration *msg = MainCore::MsgDeleteConfiguration::create(const_cast(selectedConfiguration)); + m_mainCore->m_mainMessageQueue->push(msg); + + return 202; +} + +int WebAPIAdapter::instanceConfigurationFilePut( + SWGSDRangel::SWGFilePath& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + QString filePath = *query.getFilePath(); + + if (QFileInfo::exists(filePath)) + { + QFile file(filePath); + + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) + { + QByteArray base64Str; + QTextStream instream(&file); + instream >> base64Str; + file.close(); + Configuration *newConfiguration = m_mainCore->m_settings.newConfiguration("TBD", "TBD"); + + if (newConfiguration->deserialize(QByteArray::fromBase64(base64Str))) + { + response.init(); + *response.getGroupName() = newConfiguration->getGroup(); + *response.getName() = newConfiguration->getDescription(); + return 202; + } + else + { + error.init(); + *error.getMessage() = QString("Cannot deserialize configuration from file %1").arg(filePath); + return 400; + } + } + else + { + error.init(); + *error.getMessage() = QString("Cannot read file %1").arg(filePath); + return 500; + } + } + else + { + error.init(); + *error.getMessage() = QString("File %1 is not found").arg(filePath); + return 404; + } +} + +int WebAPIAdapter::instanceConfigurationFilePost( + SWGSDRangel::SWGConfigurationImportExport& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + QString filePath = *query.getFilePath(); + + if (QFileInfo(filePath).absoluteDir().exists()) + { + SWGSDRangel::SWGConfigurationIdentifier *configurationId = query.getConfiguration(); + const Configuration *selectedConfiguration = m_mainCore->m_settings.getConfiguration( + *configurationId->getGroupName(), + *configurationId->getName()); + + if (selectedConfiguration) + { + QString base64Str = selectedConfiguration->serialize().toBase64(); + QFileInfo fileInfo(filePath); + + if (fileInfo.suffix() != "cfgx") { + filePath += ".cfgx"; + } + + QFile file(filePath); + + if (file.open(QIODevice::ReadWrite | QIODevice::Text)) + { + QTextStream outstream(&file); + outstream << base64Str; + file.close(); + response.init(); + *response.getGroupName() = selectedConfiguration->getGroup(); + *response.getName() = selectedConfiguration->getDescription(); + return 200; + } + else + { + error.init(); + *error.getMessage() = QString("Cannot open file %1 for writing").arg(filePath); + return 500; + } + } + else + { + error.init(); + *error.getMessage() = QString("There is no configuration [%1, %2]") + .arg(*configurationId->getGroupName()) + .arg(*configurationId->getName()); + return 404; + } + } + else + { + error.init(); + *error.getMessage() = QString("File %1 directory does not exist").arg(filePath); + return 404; + } +} + +int WebAPIAdapter::instanceConfigurationBlobPut( + SWGSDRangel::SWGBase64Blob& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) +{ + QString *base64Str = query.getBlob(); + + if (base64Str) + { + Configuration *newConfiguration = m_mainCore->m_settings.newConfiguration("TBD", "TBD"); + + if (newConfiguration) + { + QByteArray blob = QByteArray::fromBase64(base64Str->toUtf8()); + + if (newConfiguration->deserialize(blob)) + { + response.init(); + *response.getGroupName() = newConfiguration->getGroup(); + *response.getName() = newConfiguration->getDescription(); + return 202; + } + else + { + m_mainCore->m_settings.deleteConfiguration(newConfiguration); + error.init(); + *error.getMessage() = QString("Could not deserialize blob"); + return 400; + } + } + else + { + error.init(); + *error.getMessage() = QString("Cannot create new configuration"); + return 500; + } + } + else + { + error.init(); + *error.getMessage() = QString("Blob not specified"); + return 400; + } +} + +int WebAPIAdapter::instanceConfigurationBlobPost( + SWGSDRangel::SWGConfigurationIdentifier& query, + SWGSDRangel::SWGBase64Blob& response, + SWGSDRangel::SWGErrorResponse& error) +{ + const Configuration *selectedConfiguration = m_mainCore->m_settings.getConfiguration( + *query.getGroupName(), + *query.getName()); + + if (selectedConfiguration) + { + QString base64Str = selectedConfiguration->serialize().toBase64(); + response.init(); + *response.getBlob() = base64Str; + return 200; + } + else + { + error.init(); + *error.getMessage() = QString("There is no configuration [%1, %2]") + .arg(*query.getGroupName()) + .arg(*query.getName()); + return 404; + } +} + int WebAPIAdapter::instanceFeaturePresetsGet( SWGSDRangel::SWGFeaturePresets& response, SWGSDRangel::SWGErrorResponse& error) diff --git a/sdrbase/webapi/webapiadapter.h b/sdrbase/webapi/webapiadapter.h index 6c42f7b1e..212a9beda 100644 --- a/sdrbase/webapi/webapiadapter.h +++ b/sdrbase/webapi/webapiadapter.h @@ -195,6 +195,66 @@ public: SWGSDRangel::SWGPresetIdentifier& response, SWGSDRangel::SWGErrorResponse& error); + virtual int instancePresetFilePut( + SWGSDRangel::SWGFilePath& query, + SWGSDRangel::SWGPresetIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instancePresetFilePost( + SWGSDRangel::SWGPresetExport& query, + SWGSDRangel::SWGPresetIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instancePresetBlobPut( + SWGSDRangel::SWGBase64Blob& query, + SWGSDRangel::SWGPresetIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instancePresetBlobPost( + SWGSDRangel::SWGPresetIdentifier& query, + SWGSDRangel::SWGBase64Blob& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationsGet( + SWGSDRangel::SWGConfigurations& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationPatch( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationPut( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationPost( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationDelete( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationFilePut( + SWGSDRangel::SWGFilePath& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationFilePost( + SWGSDRangel::SWGConfigurationImportExport& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationBlobPut( + SWGSDRangel::SWGBase64Blob& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error); + + virtual int instanceConfigurationBlobPost( + SWGSDRangel::SWGConfigurationIdentifier& query, + SWGSDRangel::SWGBase64Blob& response, + SWGSDRangel::SWGErrorResponse& error); + virtual int instanceFeaturePresetsGet( SWGSDRangel::SWGFeaturePresets& response, SWGSDRangel::SWGErrorResponse& error); diff --git a/sdrbase/webapi/webapiadapterinterface.cpp b/sdrbase/webapi/webapiadapterinterface.cpp index b306b1192..f0deeab98 100644 --- a/sdrbase/webapi/webapiadapterinterface.cpp +++ b/sdrbase/webapi/webapiadapterinterface.cpp @@ -40,6 +40,11 @@ QString WebAPIAdapterInterface::instanceLimeRFEPowerURL = "/sdrangel/limerfe/pow QString WebAPIAdapterInterface::instancePresetsURL = "/sdrangel/presets"; QString WebAPIAdapterInterface::instancePresetURL = "/sdrangel/preset"; QString WebAPIAdapterInterface::instancePresetFileURL = "/sdrangel/preset/file"; +QString WebAPIAdapterInterface::instancePresetBlobURL = "/sdrangel/preset/blob"; +QString WebAPIAdapterInterface::instanceConfigurationsURL = "/sdrangel/configurations"; +QString WebAPIAdapterInterface::instanceConfigurationURL = "/sdrangel/configuration"; +QString WebAPIAdapterInterface::instanceConfigurationFileURL = "/sdrangel/configuration/file"; +QString WebAPIAdapterInterface::instanceConfigurationBlobURL = "/sdrangel/configuration/blob"; QString WebAPIAdapterInterface::instanceFeaturePresetsURL = "/sdrangel/featurepresets"; QString WebAPIAdapterInterface::instanceFeaturePresetURL = "/sdrangel/featurepreset"; QString WebAPIAdapterInterface::instanceDeviceSetsURL = "/sdrangel/devicesets"; diff --git a/sdrbase/webapi/webapiadapterinterface.h b/sdrbase/webapi/webapiadapterinterface.h index 99f543fb7..54a53d4a2 100644 --- a/sdrbase/webapi/webapiadapterinterface.h +++ b/sdrbase/webapi/webapiadapterinterface.h @@ -51,6 +51,14 @@ namespace SWGSDRangel class SWGPresetIdentifier; class SWGPresetImport; class SWGPresetExport; + class SWGPresetDeserialize; + class SWGPresetSerialize; + class SWGBase64Blob; + class SWGFilePath; + class SWGConfigurations; + class SWGConfigurationIdentifier; + class SWGConfigurationImportExport; + class SWGConfigurationDeserialize; class SWGDeviceSetList; class SWGDeviceSet; class SWGDeviceListItem; @@ -625,7 +633,7 @@ public: * returns the Http status code (default 501: not implemented) */ virtual int instancePresetFilePut( - SWGSDRangel::SWGPresetImport& query, + SWGSDRangel::SWGFilePath& query, SWGSDRangel::SWGPresetIdentifier& response, SWGSDRangel::SWGErrorResponse& error) { @@ -652,6 +660,172 @@ public: return 501; } + /** + * Handler of /sdrangel/preset/blob (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instancePresetBlobPut( + SWGSDRangel::SWGBase64Blob& query, + SWGSDRangel::SWGPresetIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) query; + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/preset/blob (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instancePresetBlobPost( + SWGSDRangel::SWGPresetIdentifier& query, + SWGSDRangel::SWGBase64Blob& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) query; + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/presets (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationsGet( + SWGSDRangel::SWGConfigurations& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration (PATCH) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationPatch( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationPut( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationPost( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration (DELETE) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationDelete( + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration/file (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationFilePut( + SWGSDRangel::SWGFilePath& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) query; + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration/file (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationFilePost( + SWGSDRangel::SWGConfigurationImportExport& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) query; + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration/blob (PUT) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationBlobPut( + SWGSDRangel::SWGBase64Blob& query, + SWGSDRangel::SWGConfigurationIdentifier& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) query; + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + + /** + * Handler of /sdrangel/configuration/blob (POST) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels + * returns the Http status code (default 501: not implemented) + */ + virtual int instanceConfigurationBlobPost( + SWGSDRangel::SWGConfigurationIdentifier& query, + SWGSDRangel::SWGBase64Blob& response, + SWGSDRangel::SWGErrorResponse& error) + { + (void) query; + (void) response; + error.init(); + *error.getMessage() = QString("Function not implemented"); + return 501; + } + /** * Handler of /sdrangel/featurepresets (GET) swagger/sdrangel/code/html2/index.html#api-Default-instanceChannels * returns the Http status code (default 501: not implemented) @@ -1468,6 +1642,11 @@ public: static QString instancePresetsURL; static QString instancePresetURL; static QString instancePresetFileURL; + static QString instancePresetBlobURL; + static QString instanceConfigurationsURL; + static QString instanceConfigurationURL; + static QString instanceConfigurationFileURL; + static QString instanceConfigurationBlobURL; static QString instanceFeaturePresetsURL; static QString instanceFeaturePresetURL; static QString instanceDeviceSetsURL; diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index 0bc50bfa3..e51727673 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -43,6 +43,11 @@ #include "SWGPresetIdentifier.h" #include "SWGPresetImport.h" #include "SWGPresetExport.h" +#include "SWGBase64Blob.h" +#include "SWGFilePath.h" +#include "SWGConfigurations.h" +#include "SWGConfigurationIdentifier.h" +#include "SWGConfigurationImportExport.h" #include "SWGDeviceSettings.h" #include "SWGDeviceState.h" #include "SWGDeviceReport.h" @@ -151,6 +156,16 @@ void WebAPIRequestMapper::service(qtwebapp::HttpRequest& request, qtwebapp::Http instancePresetService(request, response); } else if (path == WebAPIAdapterInterface::instancePresetFileURL) { instancePresetFileService(request, response); + } else if (path == WebAPIAdapterInterface::instancePresetBlobURL) { + instancePresetBlobService(request, response); + } else if (path == WebAPIAdapterInterface::instanceConfigurationsURL) { + instanceConfigurationsService(request, response); + } else if (path == WebAPIAdapterInterface::instanceConfigurationURL) { + instanceConfigurationService(request, response); + } else if (path == WebAPIAdapterInterface::instanceConfigurationFileURL) { + instanceConfigurationFileService(request, response); + } else if (path == WebAPIAdapterInterface::instanceConfigurationBlobURL) { + instanceConfigurationBlobService(request, response); } else if (path == WebAPIAdapterInterface::instanceFeaturePresetsURL) { instanceFeaturePresetsService(request, response); } else if (path == WebAPIAdapterInterface::instanceFeaturePresetURL) { @@ -1287,7 +1302,7 @@ void WebAPIRequestMapper::instancePresetFileService(qtwebapp::HttpRequest& reque if (request.getMethod() == "PUT") { - SWGSDRangel::SWGPresetImport query; + SWGSDRangel::SWGFilePath query; SWGSDRangel::SWGPresetIdentifier normalResponse; QString jsonStr = request.getBody(); QJsonObject jsonObject; @@ -1370,6 +1385,462 @@ void WebAPIRequestMapper::instancePresetFileService(qtwebapp::HttpRequest& reque } } +void WebAPIRequestMapper::instancePresetBlobService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) +{ + SWGSDRangel::SWGErrorResponse errorResponse; + response.setHeader("Content-Type", "application/json"); + response.setHeader("Access-Control-Allow-Origin", "*"); + + if (request.getMethod() == "PUT") + { + SWGSDRangel::SWGBase64Blob query; + SWGSDRangel::SWGPresetIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + query.fromJson(jsonStr); + + if (query.getBlob()) + { + int status = m_adapter->instancePresetBlobPut(query, normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else if (request.getMethod() == "POST") + { + SWGSDRangel::SWGPresetIdentifier query; + SWGSDRangel::SWGBase64Blob normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + query.fromJson(jsonStr); + + if (validatePresetIdentifer(query)) + { + int status = m_adapter->instancePresetBlobPost(query, normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(405,"Invalid HTTP method"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid HTTP method"; + response.write(errorResponse.asJson().toUtf8()); + } +} + +void WebAPIRequestMapper::instanceConfigurationsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) +{ + SWGSDRangel::SWGErrorResponse errorResponse; + response.setHeader("Content-Type", "application/json"); + response.setHeader("Access-Control-Allow-Origin", "*"); + + if (request.getMethod() == "GET") + { + SWGSDRangel::SWGConfigurations normalResponse; + int status = m_adapter->instanceConfigurationsGet(normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } +} + +void WebAPIRequestMapper::instanceConfigurationService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) +{ + SWGSDRangel::SWGErrorResponse errorResponse; + response.setHeader("Content-Type", "application/json"); + response.setHeader("Access-Control-Allow-Origin", "*"); + + if (request.getMethod() == "PATCH") + { + SWGSDRangel::SWGConfigurationIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + normalResponse.fromJson(jsonStr); + + if (validateConfigurationIdentifier(normalResponse)) + { + int status = m_adapter->instanceConfigurationPatch(normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else if (request.getMethod() == "PUT") + { + SWGSDRangel::SWGConfigurationIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + normalResponse.fromJson(jsonStr); + + if (validateConfigurationIdentifier(normalResponse)) + { + int status = m_adapter->instanceConfigurationPut(normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else if (request.getMethod() == "POST") + { + SWGSDRangel::SWGConfigurationIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + normalResponse.fromJson(jsonStr); + + if (validateConfigurationIdentifier(normalResponse)) + { + int status = m_adapter->instanceConfigurationPost(normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else if (request.getMethod() == "DELETE") + { + SWGSDRangel::SWGConfigurationIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + normalResponse.fromJson(jsonStr); + + if (validateConfigurationIdentifier(normalResponse)) + { + int status = m_adapter->instanceConfigurationDelete(normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(405,"Invalid HTTP method"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid HTTP method"; + response.write(errorResponse.asJson().toUtf8()); + } +} + +void WebAPIRequestMapper::instanceConfigurationFileService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) +{ + SWGSDRangel::SWGErrorResponse errorResponse; + response.setHeader("Content-Type", "application/json"); + response.setHeader("Access-Control-Allow-Origin", "*"); + + if (request.getMethod() == "PUT") + { + SWGSDRangel::SWGFilePath query; + SWGSDRangel::SWGConfigurationIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + query.fromJson(jsonStr); + + if (query.getFilePath()) + { + int status = m_adapter->instanceConfigurationFilePut(query, normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else if (request.getMethod() == "POST") + { + SWGSDRangel::SWGConfigurationImportExport query; + SWGSDRangel::SWGConfigurationIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + query.fromJson(jsonStr); + + if (query.getFilePath() && query.getConfiguration() && validateConfigurationIdentifier(*query.getConfiguration())) + { + int status = m_adapter->instanceConfigurationFilePost(query, normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(405,"Invalid HTTP method"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid HTTP method"; + response.write(errorResponse.asJson().toUtf8()); + } +} + +void WebAPIRequestMapper::instanceConfigurationBlobService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) +{ + SWGSDRangel::SWGErrorResponse errorResponse; + response.setHeader("Content-Type", "application/json"); + response.setHeader("Access-Control-Allow-Origin", "*"); + + if (request.getMethod() == "PUT") + { + SWGSDRangel::SWGBase64Blob query; + SWGSDRangel::SWGConfigurationIdentifier normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + query.fromJson(jsonStr); + + if (query.getBlob()) + { + int status = m_adapter->instanceConfigurationBlobPut(query, normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else if (request.getMethod() == "POST") + { + SWGSDRangel::SWGConfigurationIdentifier query; + SWGSDRangel::SWGBase64Blob normalResponse; + QString jsonStr = request.getBody(); + QJsonObject jsonObject; + + if (parseJsonBody(jsonStr, jsonObject, response)) + { + query.fromJson(jsonStr); + + if (validateConfigurationIdentifier(query)) + { + int status = m_adapter->instanceConfigurationBlobPost(query, normalResponse, errorResponse); + response.setStatus(status); + + if (status/100 == 2) { + response.write(normalResponse.asJson().toUtf8()); + } else { + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON request"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON request"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(400,"Invalid JSON format"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid JSON format"; + response.write(errorResponse.asJson().toUtf8()); + } + } + else + { + response.setStatus(405,"Invalid HTTP method"); + errorResponse.init(); + *errorResponse.getMessage() = "Invalid HTTP method"; + response.write(errorResponse.asJson().toUtf8()); + } +} + void WebAPIRequestMapper::instanceFeaturePresetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response) { SWGSDRangel::SWGErrorResponse errorResponse; @@ -3096,6 +3567,11 @@ bool WebAPIRequestMapper::validatePresetIdentifer(SWGSDRangel::SWGPresetIdentifi return (presetIdentifier.getGroupName() && presetIdentifier.getName() && presetIdentifier.getType()); } +bool WebAPIRequestMapper::validateConfigurationIdentifier(SWGSDRangel::SWGConfigurationIdentifier& configruationIdentifier) +{ + return configruationIdentifier.getGroupName() && configruationIdentifier.getName(); +} + bool WebAPIRequestMapper::validateFeaturePresetIdentifer(SWGSDRangel::SWGFeaturePresetIdentifier& presetIdentifier) { return (presetIdentifier.getGroupName() && presetIdentifier.getDescription()); @@ -3116,6 +3592,21 @@ bool WebAPIRequestMapper::validatePresetExport(SWGSDRangel::SWGPresetExport& pre return validatePresetIdentifer(*presetIdentifier); } +bool WebAPIRequestMapper::validateConfigurationImportExport(SWGSDRangel::SWGConfigurationImportExport& configurationImportExport) +{ + if (configurationImportExport.getFilePath() == nullptr) { + return false; + } + + SWGSDRangel::SWGConfigurationIdentifier *congfigurationIdentifier = configurationImportExport.getConfiguration(); + + if (congfigurationIdentifier == nullptr) { + return false; + } + + return validateConfigurationIdentifier(*congfigurationIdentifier); +} + bool WebAPIRequestMapper::validateDeviceListItem(SWGSDRangel::SWGDeviceListItem& deviceListItem, QJsonObject& jsonObject) { if (jsonObject.contains("direction")) { diff --git a/sdrbase/webapi/webapirequestmapper.h b/sdrbase/webapi/webapirequestmapper.h index 4db16278b..3e9c37b83 100644 --- a/sdrbase/webapi/webapirequestmapper.h +++ b/sdrbase/webapi/webapirequestmapper.h @@ -76,6 +76,11 @@ private: void instancePresetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instancePresetFileService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); + void instancePresetBlobService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); + void instanceConfigurationsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); + void instanceConfigurationService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); + void instanceConfigurationFileService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); + void instanceConfigurationBlobService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceFeaturePresetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceFeaturePresetService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); void instanceDeviceSetsService(qtwebapp::HttpRequest& request, qtwebapp::HttpResponse& response); @@ -124,6 +129,8 @@ private: bool validateAMBEDevices(SWGSDRangel::SWGAMBEDevices& ambeDevices, QJsonObject& jsonObject); bool validateLimeRFEConfig(SWGSDRangel::SWGLimeRFESettings& limeRFESettings, QJsonObject& jsonObject, QStringList& limeRFESettingsKeys); bool validateConfig(SWGSDRangel::SWGInstanceConfigResponse& config, QJsonObject& jsonObject, WebAPIAdapterInterface::ConfigKeys& configKeys); + bool validateConfigurationIdentifier(SWGSDRangel::SWGConfigurationIdentifier& configurationIdentifier); + bool validateConfigurationImportExport(SWGSDRangel::SWGConfigurationImportExport& configuratopmImportExport); bool appendFeatureSetPresetKeys( SWGSDRangel::SWGFeatureSetPreset *preset, diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 14e535310..a3c8a54a6 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -1599,6 +1599,28 @@ bool MainWindow::handleMessage(const Message& cmd) m_mainCore->m_settings.deletePreset(presetToDelete); return true; } + else if (MainCore::MsgLoadConfiguration::match(cmd)) + { + MainCore::MsgLoadConfiguration& notif = (MainCore::MsgLoadConfiguration&) cmd; + const Configuration *configuration = notif.getConfiguration(); + loadConfiguration(configuration, false); + return true; + } + else if (MainCore::MsgSaveConfiguration::match(cmd)) + { + MainCore::MsgSaveConfiguration& notif = (MainCore::MsgSaveConfiguration&) cmd; + Configuration *configuration = notif.getConfiguration(); + saveConfiguration(configuration); + return true; + } + else if (MainCore::MsgDeleteConfiguration::match(cmd)) + { + MainCore::MsgDeleteConfiguration& notif = (MainCore::MsgDeleteConfiguration&) cmd; + const Configuration *configurationToDelete = notif.getConfiguration(); + // remove configuration from settings + m_mainCore->m_settings.deleteConfiguration(configurationToDelete); + return true; + } else if (MainCore::MsgDeleteFeatureSetPreset::match(cmd)) { MainCore::MsgDeleteFeatureSetPreset& notif = (MainCore::MsgDeleteFeatureSetPreset&) cmd; diff --git a/sdrsrv/mainserver.cpp b/sdrsrv/mainserver.cpp index a02632844..52bfa0ec4 100644 --- a/sdrsrv/mainserver.cpp +++ b/sdrsrv/mainserver.cpp @@ -133,6 +133,14 @@ bool MainServer::handleMessage(const Message& cmd) m_mainCore->m_settings.deletePreset(presetToDelete); return true; } + else if (MainCore::MsgDeleteConfiguration::match(cmd)) + { + MainCore::MsgDeleteConfiguration& notif = (MainCore::MsgDeleteConfiguration&) cmd; + const Configuration *configuationToDelete = notif.getConfiguration(); + // remove configuration from settings + m_mainCore->m_settings.deleteConfiguration(configuationToDelete); + return true; + } else if (MainCore::MsgLoadFeatureSetPreset::match(cmd)) { MainCore::MsgLoadFeatureSetPreset& notif = (MainCore::MsgLoadFeatureSetPreset&) cmd; diff --git a/swagger/sdrangel/api/swagger/swagger.yaml b/swagger/sdrangel/api/swagger/swagger.yaml index 0490560ae..ea129fa44 100644 --- a/swagger/sdrangel/api/swagger/swagger.yaml +++ b/swagger/sdrangel/api/swagger/swagger.yaml @@ -821,7 +821,7 @@ paths: /sdrangel/preset/file: x-swagger-router-controller: instance put: - description: import a preset from file as a new preset (server only). + description: import a preset from file as a new preset. operationId: instancePresetFilePut tags: - Instance @@ -830,10 +830,10 @@ paths: parameters: - name: body in: body - description: import details + description: File path required: true schema: - $ref: "#/definitions/PresetImport" + $ref: "#/definitions/FilePath" responses: "200": description: On success return preset identification @@ -883,6 +883,337 @@ paths: "501": $ref: "#/responses/Response_501" + /sdrangel/preset/blob: + x-swagger-router-controller: instance + put: + description: deserialize base64 blob to a new preset. + operationId: instancePresetBlobPut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Blob in base64 format + required: true + schema: + $ref: "#/definitions/Base64Blob" + responses: + "200": + description: On success return preset identification + schema: + $ref: "#/definitions/PresetIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: serialize a preset to a base64 blob. + operationId: instancePresetBlobPost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Preset identification + required: true + schema: + $ref: "#/definitions/PresetIdentifier" + responses: + "200": + description: On success return blob + schema: + $ref: "#/definitions/Base64Blob" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Preset not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configurations: + x-swagger-router-controller: instance + get: + description: List all configurations in the instance + operationId: instanceConfigurationsGet + tags: + - Instance + responses: + "200": + description: On success return configurations list + schema: + $ref: "#/definitions/Configurations" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configuration: + x-swagger-router-controller: instance + patch: + description: Load a configuration + operationId: instanceConfigurationPatch + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Load configuration settings + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the selected configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: No configuration found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + put: + description: Update an existing configuration with current setup. + operationId: instanceConfigurationPut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: save setup to the configuration + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the selected configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: No configuration found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: Create a new configuration from the current setup. + operationId: instanceConfigurationPost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: save setup in a new configuration + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the created configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "409": + description: Configuration already exists + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + delete: + description: Deletes a configuration + operationId: instanceConfigurationDelete + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: delete this configuration + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "202": + description: On successful sending of the message the selected configuration identification is returned + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Configuration not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configuration/file: + x-swagger-router-controller: instance + put: + description: import a configuration from file as a new configuration. + operationId: instanceConfigurationFilePut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: File path + required: true + schema: + $ref: "#/definitions/FilePath" + responses: + "200": + description: On success return configuration identification + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: File not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: export a configuration to file. + operationId: instanceConfigurationFilePost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: export details + required: true + schema: + $ref: "#/definitions/ConfigurationImportExport" + responses: + "200": + description: On success return configuration identification + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Configuration or file path not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + + /sdrangel/configuration/blob: + x-swagger-router-controller: instance + put: + description: deserialize base64 blob to a new configuration. + operationId: instanceConfigurationBlobPut + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: Blob in base64 format + required: true + schema: + $ref: "#/definitions/Base64Blob" + responses: + "200": + description: On success return configuration identification + schema: + $ref: "#/definitions/ConfigurationIdentifier" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + post: + description: serialize a configuration to a base64 blob. + operationId: instanceConfigurationBlobPost + tags: + - Instance + consumes: + - application/json + parameters: + - name: body + in: body + description: configuration identification + required: true + schema: + $ref: "#/definitions/ConfigurationIdentifier" + responses: + "200": + description: On success return blob + schema: + $ref: "#/definitions/Base64Blob" + "400": + description: Invalid JSON request + schema: + $ref: "#/definitions/ErrorResponse" + "404": + description: Preset not found + schema: + $ref: "#/definitions/ErrorResponse" + "500": + $ref: "#/responses/Response_500" + "501": + $ref: "#/responses/Response_501" + /sdrangel/featurepresets: x-swagger-router-controller: instance get: @@ -3034,28 +3365,106 @@ definitions: $ref: "#/definitions/PresetIdentifier" PresetImport: - description: "Details to import preset from file in preset list" + description: "Details to import new preset from file" required: - filePath properties: - groupName: - description: "If present overrides imported preset group name with this name" - type: string - description: - description: "If present overrides imported preset description with this description" - type: string + preset: + description: "New preset details" + $ref: "#/definitions/PresetIdentifier" filePath: description: "Path of the import file" type: string PresetExport: - description: "Details to export a preset to file" + description: "Details to export a preset to a file" + properties: + filePath: + description: "Path of the export file" + type: string + preset: + description: "Preset to export" + $ref: "#/definitions/PresetIdentifier" + + Base64Blob: + description: "Binary blob in base64 format" + required: + - blob + properties: + blob: + description: "Blob in base64" + type: string + + FilePath: + description: "File path" + required: + - filePath + properties: + filePath: + description: "File path" + type: string + + Configurations: + description: "Configuration presets" + required: + - nbGroups + properties: + nbGroups: + description: "Number of configuration groups" + type: integer + groups: + type: array + items: + $ref: "#/definitions/ConfigurationGroup" + + ConfigurationGroup: + description: "Group of configuration" + required: + - groupName + - nbPresets + properties: + groupName: + description: "Name of the configuration group" + type: string + nbConfigurations: + description: "Number of configurations in the group" + type: integer + configurations: + type: array + items: + $ref: "#/definitions/ConfigurationItem" + + ConfigurationIdentifier: + description: "Configuration item" + required: + - groupName + - name + properties: + groupName: + description: "Name of the preset group" + type: string + name: + description: "Descriptive name of the preset" + type: string + + ConfigurationItem: + description: "Configuration preset item" + required: + - name + properties: + name: + description: "Descriptive name of the configuration" + type: string + + ConfigurationImportExport: + description: "Details to impprt/export a configuration from/to file" properties: filePath: description: "Path of the import file" type: string - preset: - $ref: "#/definitions/PresetIdentifier" + configuration: + description: "On import new configuration details. On export configuration to export from" + $ref: "#/definitions/ConfigurationIdentifier" FeaturePresets: description: "Feature settings presets" diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index e764b24ef..3a117e943 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -2502,6 +2502,16 @@ margin-bottom: 20px; } }, "description" : "A bandwidth expressed in Hertz (Hz)" +}; + defs.Base64Blob = { + "required" : [ "blob" ], + "properties" : { + "blob" : { + "type" : "string", + "description" : "Blob in base64" + } + }, + "description" : "Binary blob in base64 format" }; defs.BeamSteeringCWModSettings = { "properties" : { @@ -4005,6 +4015,79 @@ margin-bottom: 20px; } }, "description" : "A complex number" +}; + defs.ConfigurationGroup = { + "required" : [ "groupName" ], + "properties" : { + "groupName" : { + "type" : "string", + "description" : "Name of the configuration group" + }, + "nbConfigurations" : { + "type" : "integer", + "description" : "Number of configurations in the group" + }, + "configurations" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ConfigurationItem" + } + } + }, + "description" : "Group of configuration" +}; + defs.ConfigurationIdentifier = { + "required" : [ "groupName", "name" ], + "properties" : { + "groupName" : { + "type" : "string", + "description" : "Name of the preset group" + }, + "name" : { + "type" : "string", + "description" : "Descriptive name of the preset" + } + }, + "description" : "Configuration item" +}; + defs.ConfigurationImportExport = { + "properties" : { + "filePath" : { + "type" : "string", + "description" : "Path of the import file" + }, + "configuration" : { + "description" : "On import new configuration details. On export configuration to export from", + "$ref" : "#/definitions/ConfigurationIdentifier" + } + }, + "description" : "Details to impprt/export a configuration from/to file" +}; + defs.ConfigurationItem = { + "required" : [ "name" ], + "properties" : { + "name" : { + "type" : "string", + "description" : "Descriptive name of the configuration" + } + }, + "description" : "Configuration preset item" +}; + defs.Configurations = { + "required" : [ "nbGroups" ], + "properties" : { + "nbGroups" : { + "type" : "integer", + "description" : "Number of configuration groups" + }, + "groups" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/ConfigurationGroup" + } + } + }, + "description" : "Configuration presets" }; defs.DABDemodSettings = { "properties" : { @@ -5538,6 +5621,16 @@ margin-bottom: 20px; } }, "description" : "FileInput" +}; + defs.FilePath = { + "required" : [ "filePath" ], + "properties" : { + "filePath" : { + "type" : "string", + "description" : "File path" + } + }, + "description" : "File path" }; defs.FileSinkActions = { "properties" : { @@ -9811,13 +9904,14 @@ margin-bottom: 20px; "properties" : { "filePath" : { "type" : "string", - "description" : "Path of the import file" + "description" : "Path of the export file" }, "preset" : { + "description" : "Preset to export", "$ref" : "#/definitions/PresetIdentifier" } }, - "description" : "Details to export a preset to file" + "description" : "Details to export a preset to a file" }; defs.PresetGroup = { "required" : [ "groupName", "nbPresets" ], @@ -9865,20 +9959,16 @@ margin-bottom: 20px; defs.PresetImport = { "required" : [ "filePath" ], "properties" : { - "groupName" : { - "type" : "string", - "description" : "If present overrides imported preset group name with this name" - }, - "description" : { - "type" : "string", - "description" : "If present overrides imported preset description with this description" + "preset" : { + "description" : "New preset details", + "$ref" : "#/definitions/PresetIdentifier" }, "filePath" : { "type" : "string", "description" : "Path of the import file" } }, - "description" : "Details to import preset from file in preset list" + "description" : "Details to import new preset from file" }; defs.PresetItem = { "required" : [ "centerFrequency", "name", "type" ], @@ -14562,6 +14652,33 @@ margin-bottom: 20px;
  • instanceConfigPut
  • +
  • + instanceConfigurationBlobPost +
  • +
  • + instanceConfigurationBlobPut +
  • +
  • + instanceConfigurationDelete +
  • +
  • + instanceConfigurationFilePost +
  • +
  • + instanceConfigurationFilePut +
  • +
  • + instanceConfigurationPatch +
  • +
  • + instanceConfigurationPost +
  • +
  • + instanceConfigurationPut +
  • +
  • + instanceConfigurationsGet +
  • instanceDelete
  • @@ -14607,6 +14724,12 @@ margin-bottom: 20px;
  • instanceLoggingPut
  • +
  • + instancePresetBlobPost +
  • +
  • + instancePresetBlobPut +
  • instancePresetDelete
  • @@ -41446,6 +41569,4082 @@ $(document).ready(function() {
    +
    +
    +
    +

    instanceConfigurationBlobPost

    +

    +
    +
    +
    +

    +

    serialize a configuration to a base64 blob.

    +

    +
    +
    /sdrangel/configuration/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/configuration/blob"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | configuration identification
    +        try {
    +            Base64Blob result = apiInstance.instanceConfigurationBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | configuration identification
    +        try {
    +            Base64Blob result = apiInstance.instanceConfigurationBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // configuration identification
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationBlobPostWith:body
    +              completionHandler: ^(Base64Blob output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} configuration identification
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationBlobPost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationBlobPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | configuration identification
    +
    +            try
    +            {
    +                Base64Blob result = apiInstance.instanceConfigurationBlobPost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationBlobPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | configuration identification
    +
    +try {
    +    $result = $api_instance->instanceConfigurationBlobPost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationBlobPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | configuration identification
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationBlobPost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationBlobPost: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | configuration identification
    +
    +try: 
    +    api_response = api_instance.instance_configuration_blob_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationBlobPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return blob

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Preset not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationBlobPut

    +

    +
    +
    +
    +

    +

    deserialize base64 blob to a new configuration.

    +

    +
    +
    /sdrangel/configuration/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/configuration/blob"
    +
    +
    +
    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();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Base64Blob *body = ; // Blob in base64 format
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationBlobPutWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {Base64Blob} Blob in base64 format
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationBlobPut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationBlobPutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new Base64Blob(); // Base64Blob | Blob in base64 format
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationBlobPut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationBlobPut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // Base64Blob | Blob in base64 format
    +
    +try {
    +    $result = $api_instance->instanceConfigurationBlobPut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationBlobPut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::Base64Blob->new(); # Base64Blob | Blob in base64 format
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationBlobPut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationBlobPut: $@\n";
    +}
    +
    + +
    +
    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 =  # Base64Blob | Blob in base64 format
    +
    +try: 
    +    api_response = api_instance.instance_configuration_blob_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationBlobPut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return configuration identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationDelete

    +

    +
    +
    +
    +

    +

    Deletes a configuration

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | delete this configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationDelete(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationDelete");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | delete this configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationDelete(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationDelete");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // delete this configuration
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationDeleteWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} delete this configuration
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationDelete(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationDeleteExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | delete this configuration
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationDelete(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationDelete: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | delete this configuration
    +
    +try {
    +    $result = $api_instance->instanceConfigurationDelete($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationDelete: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | delete this configuration
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationDelete(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationDelete: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | delete this configuration
    +
    +try: 
    +    api_response = api_instance.instance_configuration_delete(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationDelete: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the selected configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Configuration not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationFilePost

    +

    +
    +
    +
    +

    +

    export a configuration to file.

    +

    +
    +
    /sdrangel/configuration/file
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/configuration/file"
    +
    +
    +
    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();
    +        ConfigurationImportExport body = ; // ConfigurationImportExport | export details
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationImportExport body = ; // ConfigurationImportExport | export details
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationImportExport *body = ; // export details
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationFilePostWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationImportExport} export details
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationFilePost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationFilePostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationImportExport(); // ConfigurationImportExport | export details
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationFilePost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationImportExport | export details
    +
    +try {
    +    $result = $api_instance->instanceConfigurationFilePost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationFilePost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationImportExport->new(); # ConfigurationImportExport | export details
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationFilePost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationFilePost: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationImportExport | export details
    +
    +try: 
    +    api_response = api_instance.instance_configuration_file_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationFilePost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return configuration identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Configuration or file path not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationFilePut

    +

    +
    +
    +
    +

    +

    import a configuration from file as a new configuration.

    +

    +
    +
    /sdrangel/configuration/file
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/configuration/file"
    +
    +
    +
    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();
    +        FilePath body = ; // FilePath | File path
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        FilePath body = ; // FilePath | File path
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationFilePut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    FilePath *body = ; // File path
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationFilePutWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {FilePath} File path
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationFilePut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationFilePutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new FilePath(); // FilePath | File path
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationFilePut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationFilePut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // FilePath | File path
    +
    +try {
    +    $result = $api_instance->instanceConfigurationFilePut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationFilePut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::FilePath->new(); # FilePath | File path
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationFilePut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationFilePut: $@\n";
    +}
    +
    + +
    +
    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 =  # FilePath | File path
    +
    +try: 
    +    api_response = api_instance.instance_configuration_file_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationFilePut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return configuration identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - File not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationPatch

    +

    +
    +
    +
    +

    +

    Load a configuration

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PATCH "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | Load configuration settings
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPatch(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPatch");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | Load configuration settings
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPatch(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPatch");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // Load configuration settings
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationPatchWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} Load configuration settings
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationPatch(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationPatchExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | Load configuration settings
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationPatch(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationPatch: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | Load configuration settings
    +
    +try {
    +    $result = $api_instance->instanceConfigurationPatch($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationPatch: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | Load configuration settings
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationPatch(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationPatch: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | Load configuration settings
    +
    +try: 
    +    api_response = api_instance.instance_configuration_patch(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationPatch: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the selected configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - No configuration found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationPost

    +

    +
    +
    +
    +

    +

    Create a new configuration from the current setup.

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup in a new configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup in a new configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // save setup in a new configuration
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationPostWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} save setup in a new configuration
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationPost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | save setup in a new configuration
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationPost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | save setup in a new configuration
    +
    +try {
    +    $result = $api_instance->instanceConfigurationPost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | save setup in a new configuration
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationPost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationPost: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | save setup in a new configuration
    +
    +try: 
    +    api_response = api_instance.instance_configuration_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the created configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 409 - Configuration already exists

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationPut

    +

    +
    +
    +
    +

    +

    Update an existing configuration with current setup.

    +

    +
    +
    /sdrangel/configuration
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/configuration"
    +
    +
    +
    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();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup to the configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        ConfigurationIdentifier body = ; // ConfigurationIdentifier | save setup to the configuration
    +        try {
    +            ConfigurationIdentifier result = apiInstance.instanceConfigurationPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    ConfigurationIdentifier *body = ; // save setup to the configuration
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationPutWith:body
    +              completionHandler: ^(ConfigurationIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {ConfigurationIdentifier} save setup to the configuration
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationPut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationPutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new ConfigurationIdentifier(); // ConfigurationIdentifier | save setup to the configuration
    +
    +            try
    +            {
    +                ConfigurationIdentifier result = apiInstance.instanceConfigurationPut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationPut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // ConfigurationIdentifier | save setup to the configuration
    +
    +try {
    +    $result = $api_instance->instanceConfigurationPut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationPut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::ConfigurationIdentifier->new(); # ConfigurationIdentifier | save setup to the configuration
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationPut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationPut: $@\n";
    +}
    +
    + +
    +
    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 =  # ConfigurationIdentifier | save setup to the configuration
    +
    +try: 
    +    api_response = api_instance.instance_configuration_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationPut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 202 - On successful sending of the message the selected configuration identification is returned

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - No configuration found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instanceConfigurationsGet

    +

    +
    +
    +
    +

    +

    List all configurations in the instance

    +

    +
    +
    /sdrangel/configurations
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "http://localhost/sdrangel/configurations"
    +
    +
    +
    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();
    +        try {
    +            Configurations result = apiInstance.instanceConfigurationsGet();
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationsGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        try {
    +            Configurations result = apiInstance.instanceConfigurationsGet();
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instanceConfigurationsGet");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instanceConfigurationsGetWithCompletionHandler: 
    +              ^(Configurations output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instanceConfigurationsGet(callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instanceConfigurationsGetExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +
    +            try
    +            {
    +                Configurations result = apiInstance.instanceConfigurationsGet();
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instanceConfigurationsGet: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +
    +try {
    +    $result = $api_instance->instanceConfigurationsGet();
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instanceConfigurationsGet: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +
    +eval { 
    +    my $result = $api_instance->instanceConfigurationsGet();
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instanceConfigurationsGet: $@\n";
    +}
    +
    + +
    +
    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()
    +
    +try: 
    +    api_response = api_instance.instance_configurations_get()
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instanceConfigurationsGet: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + + + + +

    Responses

    +

    Status: 200 - On success return configurations list

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    @@ -47158,6 +51357,909 @@ $(document).ready(function() {

    +
    +
    +
    +

    instancePresetBlobPost

    +

    +
    +
    +
    +

    +

    serialize a preset to a base64 blob.

    +

    +
    +
    /sdrangel/preset/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "http://localhost/sdrangel/preset/blob"
    +
    +
    +
    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();
    +        PresetIdentifier body = ; // PresetIdentifier | Preset identification
    +        try {
    +            Base64Blob result = apiInstance.instancePresetBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        PresetIdentifier body = ; // PresetIdentifier | Preset identification
    +        try {
    +            Base64Blob result = apiInstance.instancePresetBlobPost(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPost");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    PresetIdentifier *body = ; // Preset identification
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instancePresetBlobPostWith:body
    +              completionHandler: ^(Base64Blob output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {PresetIdentifier} Preset identification
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instancePresetBlobPost(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instancePresetBlobPostExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new PresetIdentifier(); // PresetIdentifier | Preset identification
    +
    +            try
    +            {
    +                Base64Blob result = apiInstance.instancePresetBlobPost(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instancePresetBlobPost: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // PresetIdentifier | Preset identification
    +
    +try {
    +    $result = $api_instance->instancePresetBlobPost($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instancePresetBlobPost: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::PresetIdentifier->new(); # PresetIdentifier | Preset identification
    +
    +eval { 
    +    my $result = $api_instance->instancePresetBlobPost(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instancePresetBlobPost: $@\n";
    +}
    +
    + +
    +
    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 =  # PresetIdentifier | Preset identification
    +
    +try: 
    +    api_response = api_instance.instance_preset_blob_post(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instancePresetBlobPost: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return blob

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 404 - Preset not found

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +

    instancePresetBlobPut

    +

    +
    +
    +
    +

    +

    deserialize base64 blob to a new preset.

    +

    +
    +
    /sdrangel/preset/blob
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "http://localhost/sdrangel/preset/blob"
    +
    +
    +
    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();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            PresetIdentifier result = apiInstance.instancePresetBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import SWGSDRangel.api.InstanceApi;
    +
    +public class InstanceApiExample {
    +
    +    public static void main(String[] args) {
    +        InstanceApi apiInstance = new InstanceApi();
    +        Base64Blob body = ; // Base64Blob | Blob in base64 format
    +        try {
    +            PresetIdentifier result = apiInstance.instancePresetBlobPut(body);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling InstanceApi#instancePresetBlobPut");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    Base64Blob *body = ; // Blob in base64 format
    +
    +InstanceApi *apiInstance = [[InstanceApi alloc] init];
    +
    +[apiInstance instancePresetBlobPutWith:body
    +              completionHandler: ^(PresetIdentifier output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var SdRangel = require('sd_rangel');
    +
    +var api = new SdRangel.InstanceApi()
    +
    +var body = ; // {Base64Blob} Blob in base64 format
    +
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.instancePresetBlobPut(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using SWGSDRangel.Api;
    +using SWGSDRangel.Client;
    +using SWGSDRangel.Model;
    +
    +namespace Example
    +{
    +    public class instancePresetBlobPutExample
    +    {
    +        public void main()
    +        {
    +            
    +            var apiInstance = new InstanceApi();
    +            var body = new Base64Blob(); // Base64Blob | Blob in base64 format
    +
    +            try
    +            {
    +                PresetIdentifier result = apiInstance.instancePresetBlobPut(body);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling InstanceApi.instancePresetBlobPut: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\Api\InstanceApi();
    +$body = ; // Base64Blob | Blob in base64 format
    +
    +try {
    +    $result = $api_instance->instancePresetBlobPut($body);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling InstanceApi->instancePresetBlobPut: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use SWGSDRangel::Configuration;
    +use SWGSDRangel::InstanceApi;
    +
    +my $api_instance = SWGSDRangel::InstanceApi->new();
    +my $body = SWGSDRangel::Object::Base64Blob->new(); # Base64Blob | Blob in base64 format
    +
    +eval { 
    +    my $result = $api_instance->instancePresetBlobPut(body => $body);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling InstanceApi->instancePresetBlobPut: $@\n";
    +}
    +
    + +
    +
    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 =  # Base64Blob | Blob in base64 format
    +
    +try: 
    +    api_response = api_instance.instance_preset_blob_put(body)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling InstanceApi->instancePresetBlobPut: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + +
    Body parameters
    + + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 200 - On success return preset identification

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 400 - Invalid JSON request

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 500 - Error

    + + + +
    +
    +
    + +
    + +
    +
    + +

    Status: 501 - Function not implemented

    + + + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    @@ -48113,7 +53215,7 @@ $(document).ready(function() {

    -

    import a preset from file as a new preset (server only).

    +

    import a preset from file as a new preset.


    /sdrangel/preset/file
    @@ -48152,7 +53254,7 @@ public class InstanceApiExample { public static void main(String[] args) { InstanceApi apiInstance = new InstanceApi(); - PresetImport body = ; // PresetImport | import details + FilePath body = ; // FilePath | File path try { PresetIdentifier result = apiInstance.instancePresetFilePut(body); System.out.println(result); @@ -48171,7 +53273,7 @@ public class InstanceApiExample { public static void main(String[] args) { InstanceApi apiInstance = new InstanceApi(); - PresetImport body = ; // PresetImport | import details + FilePath body = ; // FilePath | File path try { PresetIdentifier result = apiInstance.instancePresetFilePut(body); System.out.println(result); @@ -48187,7 +53289,7 @@ public class InstanceApiExample {
    Coming Soon!
    -->
    -
    PresetImport *body = ; // import details
    +                              
    FilePath *body = ; // File path
     
     InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
    @@ -48208,7 +53310,7 @@ InstanceApi *apiInstance = [[InstanceApi alloc] init];
     
     var api = new SdRangel.InstanceApi()
     
    -var body = ; // {PresetImport} import details
    +var body = ; // {FilePath} File path
     
     
     var callback = function(error, data, response) {
    @@ -48240,7 +53342,7 @@ namespace Example
             {
                 
                 var apiInstance = new InstanceApi();
    -            var body = new PresetImport(); // PresetImport | import details
    +            var body = new FilePath(); // FilePath | File path
     
                 try
                 {
    @@ -48262,7 +53364,7 @@ namespace Example
     require_once(__DIR__ . '/vendor/autoload.php');
     
     $api_instance = new Swagger\Client\Api\InstanceApi();
    -$body = ; // PresetImport | import details
    +$body = ; // FilePath | File path
     
     try {
         $result = $api_instance->instancePresetFilePut($body);
    @@ -48279,7 +53381,7 @@ use SWGSDRangel::Configuration;
     use SWGSDRangel::InstanceApi;
     
     my $api_instance = SWGSDRangel::InstanceApi->new();
    -my $body = SWGSDRangel::Object::PresetImport->new(); # PresetImport | import details
    +my $body = SWGSDRangel::Object::FilePath->new(); # FilePath | File path
     
     eval { 
         my $result = $api_instance->instancePresetFilePut(body => $body);
    @@ -48299,7 +53401,7 @@ from pprint import pprint
     
     # create an instance of the API class
     api_instance = swagger_sdrangel.InstanceApi()
    -body =  # PresetImport | import details
    +body =  # FilePath | File path
     
     try: 
         api_response = api_instance.instance_preset_file_put(body)
    @@ -48328,10 +53430,10 @@ $(document).ready(function() {
       var schemaWrapper = {
       "in" : "body",
       "name" : "body",
    -  "description" : "import details",
    +  "description" : "File path",
       "required" : true,
       "schema" : {
    -    "$ref" : "#/definitions/PresetImport"
    +    "$ref" : "#/definitions/FilePath"
       }
     };
       var schema = schemaWrapper.schema;
    @@ -50723,7 +55825,7 @@ except ApiException as e:
               
    - Generated 2022-05-04T08:35:39.790+02:00 + Generated 2022-05-08T19:09:57.985+02:00
    diff --git a/swagger/sdrangel/code/qt5/client/SWGBase64Blob.cpp b/swagger/sdrangel/code/qt5/client/SWGBase64Blob.cpp new file mode 100644 index 000000000..b3154fe9d --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBase64Blob.cpp @@ -0,0 +1,110 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGBase64Blob.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGBase64Blob::SWGBase64Blob(QString* json) { + init(); + this->fromJson(*json); +} + +SWGBase64Blob::SWGBase64Blob() { + blob = nullptr; + m_blob_isSet = false; +} + +SWGBase64Blob::~SWGBase64Blob() { + this->cleanup(); +} + +void +SWGBase64Blob::init() { + blob = new QString(""); + m_blob_isSet = false; +} + +void +SWGBase64Blob::cleanup() { + if(blob != nullptr) { + delete blob; + } +} + +SWGBase64Blob* +SWGBase64Blob::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGBase64Blob::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&blob, pJson["blob"], "QString", "QString"); + +} + +QString +SWGBase64Blob::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGBase64Blob::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(blob != nullptr && *blob != QString("")){ + toJsonValue(QString("blob"), blob, obj, QString("QString")); + } + + return obj; +} + +QString* +SWGBase64Blob::getBlob() { + return blob; +} +void +SWGBase64Blob::setBlob(QString* blob) { + this->blob = blob; + this->m_blob_isSet = true; +} + + +bool +SWGBase64Blob::isSet(){ + bool isObjectUpdated = false; + do{ + if(blob && *blob != QString("")){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGBase64Blob.h b/swagger/sdrangel/code/qt5/client/SWGBase64Blob.h new file mode 100644 index 000000000..0ae97d503 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGBase64Blob.h @@ -0,0 +1,59 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGBase64Blob.h + * + * Binary blob in base64 format + */ + +#ifndef SWGBase64Blob_H_ +#define SWGBase64Blob_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGBase64Blob: public SWGObject { +public: + SWGBase64Blob(); + SWGBase64Blob(QString* json); + virtual ~SWGBase64Blob(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGBase64Blob* fromJson(QString &jsonString) override; + + QString* getBlob(); + void setBlob(QString* blob); + + + virtual bool isSet() override; + +private: + QString* blob; + bool m_blob_isSet; + +}; + +} + +#endif /* SWGBase64Blob_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.cpp b/swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.cpp new file mode 100644 index 000000000..1b3869ebb --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.cpp @@ -0,0 +1,162 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGConfigurationGroup.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGConfigurationGroup::SWGConfigurationGroup(QString* json) { + init(); + this->fromJson(*json); +} + +SWGConfigurationGroup::SWGConfigurationGroup() { + group_name = nullptr; + m_group_name_isSet = false; + nb_configurations = 0; + m_nb_configurations_isSet = false; + configurations = nullptr; + m_configurations_isSet = false; +} + +SWGConfigurationGroup::~SWGConfigurationGroup() { + this->cleanup(); +} + +void +SWGConfigurationGroup::init() { + group_name = new QString(""); + m_group_name_isSet = false; + nb_configurations = 0; + m_nb_configurations_isSet = false; + configurations = new QList(); + m_configurations_isSet = false; +} + +void +SWGConfigurationGroup::cleanup() { + if(group_name != nullptr) { + delete group_name; + } + + if(configurations != nullptr) { + auto arr = configurations; + for(auto o: *arr) { + delete o; + } + delete configurations; + } +} + +SWGConfigurationGroup* +SWGConfigurationGroup::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGConfigurationGroup::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString"); + + ::SWGSDRangel::setValue(&nb_configurations, pJson["nbConfigurations"], "qint32", ""); + + + ::SWGSDRangel::setValue(&configurations, pJson["configurations"], "QList", "SWGConfigurationItem"); +} + +QString +SWGConfigurationGroup::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGConfigurationGroup::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(group_name != nullptr && *group_name != QString("")){ + toJsonValue(QString("groupName"), group_name, obj, QString("QString")); + } + if(m_nb_configurations_isSet){ + obj->insert("nbConfigurations", QJsonValue(nb_configurations)); + } + if(configurations && configurations->size() > 0){ + toJsonArray((QList*)configurations, obj, "configurations", "SWGConfigurationItem"); + } + + return obj; +} + +QString* +SWGConfigurationGroup::getGroupName() { + return group_name; +} +void +SWGConfigurationGroup::setGroupName(QString* group_name) { + this->group_name = group_name; + this->m_group_name_isSet = true; +} + +qint32 +SWGConfigurationGroup::getNbConfigurations() { + return nb_configurations; +} +void +SWGConfigurationGroup::setNbConfigurations(qint32 nb_configurations) { + this->nb_configurations = nb_configurations; + this->m_nb_configurations_isSet = true; +} + +QList* +SWGConfigurationGroup::getConfigurations() { + return configurations; +} +void +SWGConfigurationGroup::setConfigurations(QList* configurations) { + this->configurations = configurations; + this->m_configurations_isSet = true; +} + + +bool +SWGConfigurationGroup::isSet(){ + bool isObjectUpdated = false; + do{ + if(group_name && *group_name != QString("")){ + isObjectUpdated = true; break; + } + if(m_nb_configurations_isSet){ + isObjectUpdated = true; break; + } + if(configurations && (configurations->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.h b/swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.h new file mode 100644 index 000000000..df6fadf4f --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationGroup.h @@ -0,0 +1,73 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGConfigurationGroup.h + * + * Group of configuration + */ + +#ifndef SWGConfigurationGroup_H_ +#define SWGConfigurationGroup_H_ + +#include + + +#include "SWGConfigurationItem.h" +#include +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGConfigurationGroup: public SWGObject { +public: + SWGConfigurationGroup(); + SWGConfigurationGroup(QString* json); + virtual ~SWGConfigurationGroup(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGConfigurationGroup* fromJson(QString &jsonString) override; + + QString* getGroupName(); + void setGroupName(QString* group_name); + + qint32 getNbConfigurations(); + void setNbConfigurations(qint32 nb_configurations); + + QList* getConfigurations(); + void setConfigurations(QList* configurations); + + + virtual bool isSet() override; + +private: + QString* group_name; + bool m_group_name_isSet; + + qint32 nb_configurations; + bool m_nb_configurations_isSet; + + QList* configurations; + bool m_configurations_isSet; + +}; + +} + +#endif /* SWGConfigurationGroup_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.cpp b/swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.cpp new file mode 100644 index 000000000..9d5d0333a --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.cpp @@ -0,0 +1,135 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGConfigurationIdentifier.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGConfigurationIdentifier::SWGConfigurationIdentifier(QString* json) { + init(); + this->fromJson(*json); +} + +SWGConfigurationIdentifier::SWGConfigurationIdentifier() { + group_name = nullptr; + m_group_name_isSet = false; + name = nullptr; + m_name_isSet = false; +} + +SWGConfigurationIdentifier::~SWGConfigurationIdentifier() { + this->cleanup(); +} + +void +SWGConfigurationIdentifier::init() { + group_name = new QString(""); + m_group_name_isSet = false; + name = new QString(""); + m_name_isSet = false; +} + +void +SWGConfigurationIdentifier::cleanup() { + if(group_name != nullptr) { + delete group_name; + } + if(name != nullptr) { + delete name; + } +} + +SWGConfigurationIdentifier* +SWGConfigurationIdentifier::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGConfigurationIdentifier::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString"); + + ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString"); + +} + +QString +SWGConfigurationIdentifier::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGConfigurationIdentifier::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(group_name != nullptr && *group_name != QString("")){ + toJsonValue(QString("groupName"), group_name, obj, QString("QString")); + } + if(name != nullptr && *name != QString("")){ + toJsonValue(QString("name"), name, obj, QString("QString")); + } + + return obj; +} + +QString* +SWGConfigurationIdentifier::getGroupName() { + return group_name; +} +void +SWGConfigurationIdentifier::setGroupName(QString* group_name) { + this->group_name = group_name; + this->m_group_name_isSet = true; +} + +QString* +SWGConfigurationIdentifier::getName() { + return name; +} +void +SWGConfigurationIdentifier::setName(QString* name) { + this->name = name; + this->m_name_isSet = true; +} + + +bool +SWGConfigurationIdentifier::isSet(){ + bool isObjectUpdated = false; + do{ + if(group_name && *group_name != QString("")){ + isObjectUpdated = true; break; + } + if(name && *name != QString("")){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.h b/swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.h new file mode 100644 index 000000000..3635f4643 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationIdentifier.h @@ -0,0 +1,65 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGConfigurationIdentifier.h + * + * Configuration item + */ + +#ifndef SWGConfigurationIdentifier_H_ +#define SWGConfigurationIdentifier_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGConfigurationIdentifier: public SWGObject { +public: + SWGConfigurationIdentifier(); + SWGConfigurationIdentifier(QString* json); + virtual ~SWGConfigurationIdentifier(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGConfigurationIdentifier* fromJson(QString &jsonString) override; + + QString* getGroupName(); + void setGroupName(QString* group_name); + + QString* getName(); + void setName(QString* name); + + + virtual bool isSet() override; + +private: + QString* group_name; + bool m_group_name_isSet; + + QString* name; + bool m_name_isSet; + +}; + +} + +#endif /* SWGConfigurationIdentifier_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.cpp b/swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.cpp new file mode 100644 index 000000000..c5e488d56 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.cpp @@ -0,0 +1,135 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGConfigurationImportExport.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGConfigurationImportExport::SWGConfigurationImportExport(QString* json) { + init(); + this->fromJson(*json); +} + +SWGConfigurationImportExport::SWGConfigurationImportExport() { + file_path = nullptr; + m_file_path_isSet = false; + configuration = nullptr; + m_configuration_isSet = false; +} + +SWGConfigurationImportExport::~SWGConfigurationImportExport() { + this->cleanup(); +} + +void +SWGConfigurationImportExport::init() { + file_path = new QString(""); + m_file_path_isSet = false; + configuration = new SWGConfigurationIdentifier(); + m_configuration_isSet = false; +} + +void +SWGConfigurationImportExport::cleanup() { + if(file_path != nullptr) { + delete file_path; + } + if(configuration != nullptr) { + delete configuration; + } +} + +SWGConfigurationImportExport* +SWGConfigurationImportExport::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGConfigurationImportExport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&file_path, pJson["filePath"], "QString", "QString"); + + ::SWGSDRangel::setValue(&configuration, pJson["configuration"], "SWGConfigurationIdentifier", "SWGConfigurationIdentifier"); + +} + +QString +SWGConfigurationImportExport::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGConfigurationImportExport::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(file_path != nullptr && *file_path != QString("")){ + toJsonValue(QString("filePath"), file_path, obj, QString("QString")); + } + if((configuration != nullptr) && (configuration->isSet())){ + toJsonValue(QString("configuration"), configuration, obj, QString("SWGConfigurationIdentifier")); + } + + return obj; +} + +QString* +SWGConfigurationImportExport::getFilePath() { + return file_path; +} +void +SWGConfigurationImportExport::setFilePath(QString* file_path) { + this->file_path = file_path; + this->m_file_path_isSet = true; +} + +SWGConfigurationIdentifier* +SWGConfigurationImportExport::getConfiguration() { + return configuration; +} +void +SWGConfigurationImportExport::setConfiguration(SWGConfigurationIdentifier* configuration) { + this->configuration = configuration; + this->m_configuration_isSet = true; +} + + +bool +SWGConfigurationImportExport::isSet(){ + bool isObjectUpdated = false; + do{ + if(file_path && *file_path != QString("")){ + isObjectUpdated = true; break; + } + if(configuration && configuration->isSet()){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.h b/swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.h new file mode 100644 index 000000000..35822a051 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationImportExport.h @@ -0,0 +1,66 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGConfigurationImportExport.h + * + * Details to impprt/export a configuration from/to file + */ + +#ifndef SWGConfigurationImportExport_H_ +#define SWGConfigurationImportExport_H_ + +#include + + +#include "SWGConfigurationIdentifier.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGConfigurationImportExport: public SWGObject { +public: + SWGConfigurationImportExport(); + SWGConfigurationImportExport(QString* json); + virtual ~SWGConfigurationImportExport(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGConfigurationImportExport* fromJson(QString &jsonString) override; + + QString* getFilePath(); + void setFilePath(QString* file_path); + + SWGConfigurationIdentifier* getConfiguration(); + void setConfiguration(SWGConfigurationIdentifier* configuration); + + + virtual bool isSet() override; + +private: + QString* file_path; + bool m_file_path_isSet; + + SWGConfigurationIdentifier* configuration; + bool m_configuration_isSet; + +}; + +} + +#endif /* SWGConfigurationImportExport_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationItem.cpp b/swagger/sdrangel/code/qt5/client/SWGConfigurationItem.cpp new file mode 100644 index 000000000..77abda53f --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationItem.cpp @@ -0,0 +1,110 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGConfigurationItem.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGConfigurationItem::SWGConfigurationItem(QString* json) { + init(); + this->fromJson(*json); +} + +SWGConfigurationItem::SWGConfigurationItem() { + name = nullptr; + m_name_isSet = false; +} + +SWGConfigurationItem::~SWGConfigurationItem() { + this->cleanup(); +} + +void +SWGConfigurationItem::init() { + name = new QString(""); + m_name_isSet = false; +} + +void +SWGConfigurationItem::cleanup() { + if(name != nullptr) { + delete name; + } +} + +SWGConfigurationItem* +SWGConfigurationItem::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGConfigurationItem::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString"); + +} + +QString +SWGConfigurationItem::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGConfigurationItem::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(name != nullptr && *name != QString("")){ + toJsonValue(QString("name"), name, obj, QString("QString")); + } + + return obj; +} + +QString* +SWGConfigurationItem::getName() { + return name; +} +void +SWGConfigurationItem::setName(QString* name) { + this->name = name; + this->m_name_isSet = true; +} + + +bool +SWGConfigurationItem::isSet(){ + bool isObjectUpdated = false; + do{ + if(name && *name != QString("")){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurationItem.h b/swagger/sdrangel/code/qt5/client/SWGConfigurationItem.h new file mode 100644 index 000000000..4df16fb76 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurationItem.h @@ -0,0 +1,59 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGConfigurationItem.h + * + * Configuration preset item + */ + +#ifndef SWGConfigurationItem_H_ +#define SWGConfigurationItem_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGConfigurationItem: public SWGObject { +public: + SWGConfigurationItem(); + SWGConfigurationItem(QString* json); + virtual ~SWGConfigurationItem(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGConfigurationItem* fromJson(QString &jsonString) override; + + QString* getName(); + void setName(QString* name); + + + virtual bool isSet() override; + +private: + QString* name; + bool m_name_isSet; + +}; + +} + +#endif /* SWGConfigurationItem_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurations.cpp b/swagger/sdrangel/code/qt5/client/SWGConfigurations.cpp new file mode 100644 index 000000000..cdb8b896a --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurations.cpp @@ -0,0 +1,137 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGConfigurations.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGConfigurations::SWGConfigurations(QString* json) { + init(); + this->fromJson(*json); +} + +SWGConfigurations::SWGConfigurations() { + nb_groups = 0; + m_nb_groups_isSet = false; + groups = nullptr; + m_groups_isSet = false; +} + +SWGConfigurations::~SWGConfigurations() { + this->cleanup(); +} + +void +SWGConfigurations::init() { + nb_groups = 0; + m_nb_groups_isSet = false; + groups = new QList(); + m_groups_isSet = false; +} + +void +SWGConfigurations::cleanup() { + + if(groups != nullptr) { + auto arr = groups; + for(auto o: *arr) { + delete o; + } + delete groups; + } +} + +SWGConfigurations* +SWGConfigurations::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGConfigurations::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&nb_groups, pJson["nbGroups"], "qint32", ""); + + + ::SWGSDRangel::setValue(&groups, pJson["groups"], "QList", "SWGConfigurationGroup"); +} + +QString +SWGConfigurations::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGConfigurations::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(m_nb_groups_isSet){ + obj->insert("nbGroups", QJsonValue(nb_groups)); + } + if(groups && groups->size() > 0){ + toJsonArray((QList*)groups, obj, "groups", "SWGConfigurationGroup"); + } + + return obj; +} + +qint32 +SWGConfigurations::getNbGroups() { + return nb_groups; +} +void +SWGConfigurations::setNbGroups(qint32 nb_groups) { + this->nb_groups = nb_groups; + this->m_nb_groups_isSet = true; +} + +QList* +SWGConfigurations::getGroups() { + return groups; +} +void +SWGConfigurations::setGroups(QList* groups) { + this->groups = groups; + this->m_groups_isSet = true; +} + + +bool +SWGConfigurations::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_nb_groups_isSet){ + isObjectUpdated = true; break; + } + if(groups && (groups->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGConfigurations.h b/swagger/sdrangel/code/qt5/client/SWGConfigurations.h new file mode 100644 index 000000000..c873fbeb2 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGConfigurations.h @@ -0,0 +1,66 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGConfigurations.h + * + * Configuration presets + */ + +#ifndef SWGConfigurations_H_ +#define SWGConfigurations_H_ + +#include + + +#include "SWGConfigurationGroup.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGConfigurations: public SWGObject { +public: + SWGConfigurations(); + SWGConfigurations(QString* json); + virtual ~SWGConfigurations(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGConfigurations* fromJson(QString &jsonString) override; + + qint32 getNbGroups(); + void setNbGroups(qint32 nb_groups); + + QList* getGroups(); + void setGroups(QList* groups); + + + virtual bool isSet() override; + +private: + qint32 nb_groups; + bool m_nb_groups_isSet; + + QList* groups; + bool m_groups_isSet; + +}; + +} + +#endif /* SWGConfigurations_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGFilePath.cpp b/swagger/sdrangel/code/qt5/client/SWGFilePath.cpp new file mode 100644 index 000000000..54617d70e --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFilePath.cpp @@ -0,0 +1,110 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGFilePath.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGFilePath::SWGFilePath(QString* json) { + init(); + this->fromJson(*json); +} + +SWGFilePath::SWGFilePath() { + file_path = nullptr; + m_file_path_isSet = false; +} + +SWGFilePath::~SWGFilePath() { + this->cleanup(); +} + +void +SWGFilePath::init() { + file_path = new QString(""); + m_file_path_isSet = false; +} + +void +SWGFilePath::cleanup() { + if(file_path != nullptr) { + delete file_path; + } +} + +SWGFilePath* +SWGFilePath::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGFilePath::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&file_path, pJson["filePath"], "QString", "QString"); + +} + +QString +SWGFilePath::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGFilePath::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(file_path != nullptr && *file_path != QString("")){ + toJsonValue(QString("filePath"), file_path, obj, QString("QString")); + } + + return obj; +} + +QString* +SWGFilePath::getFilePath() { + return file_path; +} +void +SWGFilePath::setFilePath(QString* file_path) { + this->file_path = file_path; + this->m_file_path_isSet = true; +} + + +bool +SWGFilePath::isSet(){ + bool isObjectUpdated = false; + do{ + if(file_path && *file_path != QString("")){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFilePath.h b/swagger/sdrangel/code/qt5/client/SWGFilePath.h new file mode 100644 index 000000000..bdaebd32c --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFilePath.h @@ -0,0 +1,59 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 6.0.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGFilePath.h + * + * File path + */ + +#ifndef SWGFilePath_H_ +#define SWGFilePath_H_ + +#include + + +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGFilePath: public SWGObject { +public: + SWGFilePath(); + SWGFilePath(QString* json); + virtual ~SWGFilePath(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGFilePath* fromJson(QString &jsonString) override; + + QString* getFilePath(); + void setFilePath(QString* file_path); + + + virtual bool isSet() override; + +private: + QString* file_path; + bool m_file_path_isSet; + +}; + +} + +#endif /* SWGFilePath_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp index 42cf8de55..714737d5a 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.cpp @@ -892,6 +892,498 @@ SWGInstanceApi::instanceConfigPutCallback(SWGHttpRequestWorker * worker) { } } +void +SWGInstanceApi::instanceConfigurationBlobPost(SWGConfigurationIdentifier& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration/blob"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationBlobPostCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationBlobPostCallback(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); + SWGBase64Blob* output = static_cast(create(json, QString("SWGBase64Blob"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationBlobPostSignal(output); + } else { + emit instanceConfigurationBlobPostSignalE(output, error_type, error_str); + emit instanceConfigurationBlobPostSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationBlobPut(SWGBase64Blob& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration/blob"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "PUT"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationBlobPutCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationBlobPutCallback(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); + SWGConfigurationIdentifier* output = static_cast(create(json, QString("SWGConfigurationIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationBlobPutSignal(output); + } else { + emit instanceConfigurationBlobPutSignalE(output, error_type, error_str); + emit instanceConfigurationBlobPutSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationDelete(SWGConfigurationIdentifier& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "DELETE"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationDeleteCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationDeleteCallback(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); + SWGConfigurationIdentifier* output = static_cast(create(json, QString("SWGConfigurationIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationDeleteSignal(output); + } else { + emit instanceConfigurationDeleteSignalE(output, error_type, error_str); + emit instanceConfigurationDeleteSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationFilePost(SWGConfigurationImportExport& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration/file"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationFilePostCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationFilePostCallback(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); + SWGConfigurationIdentifier* output = static_cast(create(json, QString("SWGConfigurationIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationFilePostSignal(output); + } else { + emit instanceConfigurationFilePostSignalE(output, error_type, error_str); + emit instanceConfigurationFilePostSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationFilePut(SWGFilePath& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration/file"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "PUT"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationFilePutCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationFilePutCallback(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); + SWGConfigurationIdentifier* output = static_cast(create(json, QString("SWGConfigurationIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationFilePutSignal(output); + } else { + emit instanceConfigurationFilePutSignalE(output, error_type, error_str); + emit instanceConfigurationFilePutSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationPatch(SWGConfigurationIdentifier& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "PATCH"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationPatchCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationPatchCallback(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); + SWGConfigurationIdentifier* output = static_cast(create(json, QString("SWGConfigurationIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationPatchSignal(output); + } else { + emit instanceConfigurationPatchSignalE(output, error_type, error_str); + emit instanceConfigurationPatchSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationPost(SWGConfigurationIdentifier& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationPostCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationPostCallback(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); + SWGConfigurationIdentifier* output = static_cast(create(json, QString("SWGConfigurationIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationPostSignal(output); + } else { + emit instanceConfigurationPostSignalE(output, error_type, error_str); + emit instanceConfigurationPostSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationPut(SWGConfigurationIdentifier& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configuration"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "PUT"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationPutCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationPutCallback(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); + SWGConfigurationIdentifier* output = static_cast(create(json, QString("SWGConfigurationIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationPutSignal(output); + } else { + emit instanceConfigurationPutSignalE(output, error_type, error_str); + emit instanceConfigurationPutSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instanceConfigurationsGet() { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/configurations"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "GET"); + + + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instanceConfigurationsGetCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instanceConfigurationsGetCallback(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); + SWGConfigurations* output = static_cast(create(json, QString("SWGConfigurations"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instanceConfigurationsGetSignal(output); + } else { + emit instanceConfigurationsGetSignalE(output, error_type, error_str); + emit instanceConfigurationsGetSignalEFull(worker, error_type, error_str); + } +} + void SWGInstanceApi::instanceDelete() { QString fullPath; @@ -1711,6 +2203,116 @@ SWGInstanceApi::instanceLoggingPutCallback(SWGHttpRequestWorker * worker) { } } +void +SWGInstanceApi::instancePresetBlobPost(SWGPresetIdentifier& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset/blob"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "POST"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instancePresetBlobPostCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instancePresetBlobPostCallback(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); + SWGBase64Blob* output = static_cast(create(json, QString("SWGBase64Blob"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instancePresetBlobPostSignal(output); + } else { + emit instancePresetBlobPostSignalE(output, error_type, error_str); + emit instancePresetBlobPostSignalEFull(worker, error_type, error_str); + } +} + +void +SWGInstanceApi::instancePresetBlobPut(SWGBase64Blob& body) { + QString fullPath; + fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset/blob"); + + + + SWGHttpRequestWorker *worker = new SWGHttpRequestWorker(); + SWGHttpRequestInput input(fullPath, "PUT"); + + + + QString output = body.asJson(); + input.request_body.append(output.toUtf8()); + + + + foreach(QString key, this->defaultHeaders.keys()) { + input.headers.insert(key, this->defaultHeaders.value(key)); + } + + connect(worker, + &SWGHttpRequestWorker::on_execution_finished, + this, + &SWGInstanceApi::instancePresetBlobPutCallback); + + worker->execute(&input); +} + +void +SWGInstanceApi::instancePresetBlobPutCallback(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); + SWGPresetIdentifier* output = static_cast(create(json, QString("SWGPresetIdentifier"))); + worker->deleteLater(); + + if (worker->error_type == QNetworkReply::NoError) { + emit instancePresetBlobPutSignal(output); + } else { + emit instancePresetBlobPutSignalE(output, error_type, error_str); + emit instancePresetBlobPutSignalEFull(worker, error_type, error_str); + } +} + void SWGInstanceApi::instancePresetDelete(SWGPresetIdentifier& body) { QString fullPath; @@ -1822,7 +2424,7 @@ SWGInstanceApi::instancePresetFilePostCallback(SWGHttpRequestWorker * worker) { } void -SWGInstanceApi::instancePresetFilePut(SWGPresetImport& body) { +SWGInstanceApi::instancePresetFilePut(SWGFilePath& body) { QString fullPath; fullPath.append(this->host).append(this->basePath).append("/sdrangel/preset/file"); diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h index 8aeb3db09..b49b7a0f6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceApi.h @@ -20,11 +20,16 @@ #include "SWGAudioDevices.h" #include "SWGAudioInputDevice.h" #include "SWGAudioOutputDevice.h" +#include "SWGBase64Blob.h" +#include "SWGConfigurationIdentifier.h" +#include "SWGConfigurationImportExport.h" +#include "SWGConfigurations.h" #include "SWGDVSerialDevices.h" #include "SWGDeviceSetList.h" #include "SWGErrorResponse.h" #include "SWGFeaturePresetIdentifier.h" #include "SWGFeaturePresets.h" +#include "SWGFilePath.h" #include "SWGInstanceChannelsResponse.h" #include "SWGInstanceConfigResponse.h" #include "SWGInstanceDevicesResponse.h" @@ -37,7 +42,6 @@ #include "SWGLoggingInfo.h" #include "SWGPresetExport.h" #include "SWGPresetIdentifier.h" -#include "SWGPresetImport.h" #include "SWGPresetTransfer.h" #include "SWGPresets.h" #include "SWGSuccessResponse.h" @@ -74,6 +78,15 @@ public: void instanceConfigGet(); void instanceConfigPatch(SWGInstanceConfigResponse& body); void instanceConfigPut(SWGInstanceConfigResponse& body); + void instanceConfigurationBlobPost(SWGConfigurationIdentifier& body); + void instanceConfigurationBlobPut(SWGBase64Blob& body); + void instanceConfigurationDelete(SWGConfigurationIdentifier& body); + void instanceConfigurationFilePost(SWGConfigurationImportExport& body); + void instanceConfigurationFilePut(SWGFilePath& body); + void instanceConfigurationPatch(SWGConfigurationIdentifier& body); + void instanceConfigurationPost(SWGConfigurationIdentifier& body); + void instanceConfigurationPut(SWGConfigurationIdentifier& body); + void instanceConfigurationsGet(); void instanceDelete(); void instanceDeviceSetsGet(); void instanceDevices(qint32 direction); @@ -89,9 +102,11 @@ public: void instanceLocationPut(SWGLocationInformation& body); void instanceLoggingGet(); void instanceLoggingPut(SWGLoggingInfo& body); + void instancePresetBlobPost(SWGPresetIdentifier& body); + void instancePresetBlobPut(SWGBase64Blob& body); void instancePresetDelete(SWGPresetIdentifier& body); void instancePresetFilePost(SWGPresetExport& body); - void instancePresetFilePut(SWGPresetImport& body); + void instancePresetFilePut(SWGFilePath& body); void instancePresetGet(); void instancePresetPatch(SWGPresetTransfer& body); void instancePresetPost(SWGPresetTransfer& body); @@ -115,6 +130,15 @@ private: void instanceConfigGetCallback (SWGHttpRequestWorker * worker); void instanceConfigPatchCallback (SWGHttpRequestWorker * worker); void instanceConfigPutCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationBlobPostCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationBlobPutCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationDeleteCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationFilePostCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationFilePutCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationPatchCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationPostCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationPutCallback (SWGHttpRequestWorker * worker); + void instanceConfigurationsGetCallback (SWGHttpRequestWorker * worker); void instanceDeleteCallback (SWGHttpRequestWorker * worker); void instanceDeviceSetsGetCallback (SWGHttpRequestWorker * worker); void instanceDevicesCallback (SWGHttpRequestWorker * worker); @@ -130,6 +154,8 @@ private: void instanceLocationPutCallback (SWGHttpRequestWorker * worker); void instanceLoggingGetCallback (SWGHttpRequestWorker * worker); void instanceLoggingPutCallback (SWGHttpRequestWorker * worker); + void instancePresetBlobPostCallback (SWGHttpRequestWorker * worker); + void instancePresetBlobPutCallback (SWGHttpRequestWorker * worker); void instancePresetDeleteCallback (SWGHttpRequestWorker * worker); void instancePresetFilePostCallback (SWGHttpRequestWorker * worker); void instancePresetFilePutCallback (SWGHttpRequestWorker * worker); @@ -156,6 +182,15 @@ signals: void instanceConfigGetSignal(SWGInstanceConfigResponse* summary); void instanceConfigPatchSignal(SWGSuccessResponse* summary); void instanceConfigPutSignal(SWGSuccessResponse* summary); + void instanceConfigurationBlobPostSignal(SWGBase64Blob* summary); + void instanceConfigurationBlobPutSignal(SWGConfigurationIdentifier* summary); + void instanceConfigurationDeleteSignal(SWGConfigurationIdentifier* summary); + void instanceConfigurationFilePostSignal(SWGConfigurationIdentifier* summary); + void instanceConfigurationFilePutSignal(SWGConfigurationIdentifier* summary); + void instanceConfigurationPatchSignal(SWGConfigurationIdentifier* summary); + void instanceConfigurationPostSignal(SWGConfigurationIdentifier* summary); + void instanceConfigurationPutSignal(SWGConfigurationIdentifier* summary); + void instanceConfigurationsGetSignal(SWGConfigurations* summary); void instanceDeleteSignal(SWGInstanceSummaryResponse* summary); void instanceDeviceSetsGetSignal(SWGDeviceSetList* summary); void instanceDevicesSignal(SWGInstanceDevicesResponse* summary); @@ -171,6 +206,8 @@ signals: void instanceLocationPutSignal(SWGLocationInformation* summary); void instanceLoggingGetSignal(SWGLoggingInfo* summary); void instanceLoggingPutSignal(SWGLoggingInfo* summary); + void instancePresetBlobPostSignal(SWGBase64Blob* summary); + void instancePresetBlobPutSignal(SWGPresetIdentifier* summary); void instancePresetDeleteSignal(SWGPresetIdentifier* summary); void instancePresetFilePostSignal(SWGPresetIdentifier* summary); void instancePresetFilePutSignal(SWGPresetIdentifier* summary); @@ -196,6 +233,15 @@ signals: void instanceConfigGetSignalE(SWGInstanceConfigResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceConfigPatchSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceConfigPutSignalE(SWGSuccessResponse* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationBlobPostSignalE(SWGBase64Blob* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationBlobPutSignalE(SWGConfigurationIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationDeleteSignalE(SWGConfigurationIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationFilePostSignalE(SWGConfigurationIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationFilePutSignalE(SWGConfigurationIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationPatchSignalE(SWGConfigurationIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationPostSignalE(SWGConfigurationIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationPutSignalE(SWGConfigurationIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationsGetSignalE(SWGConfigurations* 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); @@ -211,6 +257,8 @@ signals: void instanceLocationPutSignalE(SWGLocationInformation* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLoggingGetSignalE(SWGLoggingInfo* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLoggingPutSignalE(SWGLoggingInfo* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instancePresetBlobPostSignalE(SWGBase64Blob* summary, QNetworkReply::NetworkError error_type, QString& error_str); + void instancePresetBlobPutSignalE(SWGPresetIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instancePresetDeleteSignalE(SWGPresetIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instancePresetFilePostSignalE(SWGPresetIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); void instancePresetFilePutSignalE(SWGPresetIdentifier* summary, QNetworkReply::NetworkError error_type, QString& error_str); @@ -236,6 +284,15 @@ signals: void instanceConfigGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceConfigPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceConfigPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationBlobPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationBlobPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationFilePostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationFilePutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationPatchSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instanceConfigurationsGetSignalEFull(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); @@ -251,6 +308,8 @@ signals: void instanceLocationPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLoggingGetSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instanceLoggingPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instancePresetBlobPostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); + void instancePresetBlobPutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instancePresetDeleteSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instancePresetFilePostSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); void instancePresetFilePutSignalEFull(SWGHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString& error_str); diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 6594f5cff..3009f2864 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -54,6 +54,7 @@ #include "SWGBFMDemodReport.h" #include "SWGBFMDemodSettings.h" #include "SWGBandwidth.h" +#include "SWGBase64Blob.h" #include "SWGBeamSteeringCWModSettings.h" #include "SWGBladeRF1InputSettings.h" #include "SWGBladeRF1OutputSettings.h" @@ -80,6 +81,11 @@ #include "SWGChirpChatModSettings.h" #include "SWGCommand.h" #include "SWGComplex.h" +#include "SWGConfigurationGroup.h" +#include "SWGConfigurationIdentifier.h" +#include "SWGConfigurationImportExport.h" +#include "SWGConfigurationItem.h" +#include "SWGConfigurations.h" #include "SWGDABDemodSettings.h" #include "SWGDATVDemodReport.h" #include "SWGDATVDemodSettings.h" @@ -116,6 +122,7 @@ #include "SWGFileInputReport.h" #include "SWGFileInputSettings.h" #include "SWGFileOutputSettings.h" +#include "SWGFilePath.h" #include "SWGFileSinkActions.h" #include "SWGFileSinkReport.h" #include "SWGFileSinkSettings.h" @@ -520,6 +527,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGBase64Blob").compare(type) == 0) { + SWGBase64Blob *obj = new SWGBase64Blob(); + obj->init(); + return obj; + } if(QString("SWGBeamSteeringCWModSettings").compare(type) == 0) { SWGBeamSteeringCWModSettings *obj = new SWGBeamSteeringCWModSettings(); obj->init(); @@ -650,6 +662,31 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGConfigurationGroup").compare(type) == 0) { + SWGConfigurationGroup *obj = new SWGConfigurationGroup(); + obj->init(); + return obj; + } + if(QString("SWGConfigurationIdentifier").compare(type) == 0) { + SWGConfigurationIdentifier *obj = new SWGConfigurationIdentifier(); + obj->init(); + return obj; + } + if(QString("SWGConfigurationImportExport").compare(type) == 0) { + SWGConfigurationImportExport *obj = new SWGConfigurationImportExport(); + obj->init(); + return obj; + } + if(QString("SWGConfigurationItem").compare(type) == 0) { + SWGConfigurationItem *obj = new SWGConfigurationItem(); + obj->init(); + return obj; + } + if(QString("SWGConfigurations").compare(type) == 0) { + SWGConfigurations *obj = new SWGConfigurations(); + obj->init(); + return obj; + } if(QString("SWGDABDemodSettings").compare(type) == 0) { SWGDABDemodSettings *obj = new SWGDABDemodSettings(); obj->init(); @@ -830,6 +867,11 @@ namespace SWGSDRangel { obj->init(); return obj; } + if(QString("SWGFilePath").compare(type) == 0) { + SWGFilePath *obj = new SWGFilePath(); + obj->init(); + return obj; + } if(QString("SWGFileSinkActions").compare(type) == 0) { SWGFileSinkActions *obj = new SWGFileSinkActions(); obj->init(); diff --git a/swagger/sdrangel/code/qt5/client/SWGPresetExport.h b/swagger/sdrangel/code/qt5/client/SWGPresetExport.h index 5d3630165..c5f1b51a3 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPresetExport.h +++ b/swagger/sdrangel/code/qt5/client/SWGPresetExport.h @@ -13,7 +13,7 @@ /* * SWGPresetExport.h * - * Details to export a preset to file + * Details to export a preset to a file */ #ifndef SWGPresetExport_H_ diff --git a/swagger/sdrangel/code/qt5/client/SWGPresetImport.cpp b/swagger/sdrangel/code/qt5/client/SWGPresetImport.cpp index 5428957f0..a2aea6dbc 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPresetImport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGPresetImport.cpp @@ -28,10 +28,8 @@ SWGPresetImport::SWGPresetImport(QString* json) { } SWGPresetImport::SWGPresetImport() { - group_name = nullptr; - m_group_name_isSet = false; - description = nullptr; - m_description_isSet = false; + preset = nullptr; + m_preset_isSet = false; file_path = nullptr; m_file_path_isSet = false; } @@ -42,21 +40,16 @@ SWGPresetImport::~SWGPresetImport() { void SWGPresetImport::init() { - group_name = new QString(""); - m_group_name_isSet = false; - description = new QString(""); - m_description_isSet = false; + preset = new SWGPresetIdentifier(); + m_preset_isSet = false; file_path = new QString(""); m_file_path_isSet = false; } void SWGPresetImport::cleanup() { - if(group_name != nullptr) { - delete group_name; - } - if(description != nullptr) { - delete description; + if(preset != nullptr) { + delete preset; } if(file_path != nullptr) { delete file_path; @@ -74,9 +67,7 @@ SWGPresetImport::fromJson(QString &json) { void SWGPresetImport::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&group_name, pJson["groupName"], "QString", "QString"); - - ::SWGSDRangel::setValue(&description, pJson["description"], "QString", "QString"); + ::SWGSDRangel::setValue(&preset, pJson["preset"], "SWGPresetIdentifier", "SWGPresetIdentifier"); ::SWGSDRangel::setValue(&file_path, pJson["filePath"], "QString", "QString"); @@ -96,11 +87,8 @@ SWGPresetImport::asJson () QJsonObject* SWGPresetImport::asJsonObject() { QJsonObject* obj = new QJsonObject(); - if(group_name != nullptr && *group_name != QString("")){ - toJsonValue(QString("groupName"), group_name, obj, QString("QString")); - } - if(description != nullptr && *description != QString("")){ - toJsonValue(QString("description"), description, obj, QString("QString")); + if((preset != nullptr) && (preset->isSet())){ + toJsonValue(QString("preset"), preset, obj, QString("SWGPresetIdentifier")); } if(file_path != nullptr && *file_path != QString("")){ toJsonValue(QString("filePath"), file_path, obj, QString("QString")); @@ -109,24 +97,14 @@ SWGPresetImport::asJsonObject() { return obj; } -QString* -SWGPresetImport::getGroupName() { - return group_name; +SWGPresetIdentifier* +SWGPresetImport::getPreset() { + return preset; } void -SWGPresetImport::setGroupName(QString* group_name) { - this->group_name = group_name; - this->m_group_name_isSet = true; -} - -QString* -SWGPresetImport::getDescription() { - return description; -} -void -SWGPresetImport::setDescription(QString* description) { - this->description = description; - this->m_description_isSet = true; +SWGPresetImport::setPreset(SWGPresetIdentifier* preset) { + this->preset = preset; + this->m_preset_isSet = true; } QString* @@ -144,10 +122,7 @@ bool SWGPresetImport::isSet(){ bool isObjectUpdated = false; do{ - if(group_name && *group_name != QString("")){ - isObjectUpdated = true; break; - } - if(description && *description != QString("")){ + if(preset && preset->isSet()){ isObjectUpdated = true; break; } if(file_path && *file_path != QString("")){ diff --git a/swagger/sdrangel/code/qt5/client/SWGPresetImport.h b/swagger/sdrangel/code/qt5/client/SWGPresetImport.h index 56163917a..bc48be7df 100644 --- a/swagger/sdrangel/code/qt5/client/SWGPresetImport.h +++ b/swagger/sdrangel/code/qt5/client/SWGPresetImport.h @@ -13,7 +13,7 @@ /* * SWGPresetImport.h * - * Details to import preset from file in preset list + * Details to import new preset from file */ #ifndef SWGPresetImport_H_ @@ -22,6 +22,7 @@ #include +#include "SWGPresetIdentifier.h" #include #include "SWGObject.h" @@ -42,11 +43,8 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGPresetImport* fromJson(QString &jsonString) override; - QString* getGroupName(); - void setGroupName(QString* group_name); - - QString* getDescription(); - void setDescription(QString* description); + SWGPresetIdentifier* getPreset(); + void setPreset(SWGPresetIdentifier* preset); QString* getFilePath(); void setFilePath(QString* file_path); @@ -55,11 +53,8 @@ public: virtual bool isSet() override; private: - QString* group_name; - bool m_group_name_isSet; - - QString* description; - bool m_description_isSet; + SWGPresetIdentifier* preset; + bool m_preset_isSet; QString* file_path; bool m_file_path_isSet;