diff --git a/doc/pages/manager-api/index.html b/doc/pages/manager-api/index.html index 06e984f32..0cba9d9d0 100644 --- a/doc/pages/manager-api/index.html +++ b/doc/pages/manager-api/index.html @@ -738,11 +738,11 @@ } }; defs.casOptions = { + "required" : [ "service" ], "type" : "object", "properties" : { "service" : { - "type" : "string", - "default" : "none" + "type" : "string" }, "userAttribute" : { "type" : "string", @@ -766,6 +766,90 @@ "type" : "string" } } +}; + defs.MenuApp = { + "required" : [ "confKey" ], + "type" : "object", + "properties" : { + "confKey" : { + "$ref" : "#/components/schemas/confKey" + }, + "order" : { + "type" : "integer" + }, + "options" : { + "$ref" : "#/components/schemas/MenuAppOptions" + } + } +}; + defs.MenuAppOptions = { + "required" : [ "name" ], + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "tooltip" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "uri" : { + "type" : "string" + }, + "logo" : { + "type" : "string", + "default" : "network.png", + "enum" : [ "attach.png", "bell.png", "bookmark.png", "configure.png", "database.png", "demo.png", "folder.png", "gear.png", "help.png", "llng.png", "mailappt.png", "money.png", "network.png", "terminal.png", "thumbnail.png", "tux.png", "web.png", "(Any reference to an available image in app logo folder)" ] + }, + "display" : { + "type" : "string", + "default" : "auto", + "enum" : [ "on", "off", "auto", "(Any special rule to apply for example \"$uid eq 'dwho'\")" ] + } + } +}; + defs.MenuAppUpdate = { + "type" : "object", + "properties" : { + "order" : { + "type" : "integer" + }, + "options" : { + "$ref" : "#/components/schemas/MenuAppOptions" + } + } +}; + defs.MenuCat = { + "required" : [ "catname", "confKey" ], + "type" : "object", + "properties" : { + "confKey" : { + "$ref" : "#/components/schemas/confKey" + }, + "catname" : { + "type" : "string" + }, + "order" : { + "type" : "integer" + } + } +}; + defs.menuCatConfKey = { + "pattern" : "^\\w[\\w\\.\\-]*$", + "type" : "string" +}; + defs.MenuCatUpdate = { + "type" : "object", + "properties" : { + "catname" : { + "type" : "string" + }, + "order" : { + "type" : "integer" + } + } }; defs.OidcOptions = { "type" : "object", @@ -1094,8 +1178,8 @@
  • findCasAppByConfKey
  • -
  • - findCasAppsByServiceUrl +
  • + findCasAppByServiceUrl
  • getCasAppByConfKey @@ -1125,6 +1209,47 @@
  • getSecondFactorsByType
  • + +
  • + addMenuApp +
  • +
  • + deleteMenuApp +
  • +
  • + findMenuAppByConfKey +
  • +
  • + getMenuAppByConfKey +
  • +
  • + getMenuApps +
  • +
  • + replaceMenuApp +
  • +
  • + updateMenuApp +
  • + +
  • + addMenuCat +
  • +
  • + deleteMenuCat +
  • +
  • + findMenuCatByConfKey +
  • +
  • + getMenuCatByConfKey +
  • +
  • + replaceMenuCat +
  • +
  • + updateMenuCat +
  • addoidcrp @@ -2233,11 +2358,11 @@ except ApiException as e:
    -
    -
    +
    +
    -

    findCasAppsByServiceUrl

    -

    Finds CAS applications by Service URL

    +

    findCasAppByServiceUrl

    +

    Get CAS Application by Service URL

    @@ -2250,24 +2375,24 @@ except ApiException as e:

    Usage and SDK Samples

    -
    +
    curl -X GET "/api/v1/api/v1/providers/cas/app/findByServiceUrl?serviceUrl="
    -
    +
    import io.swagger.client.*;
     import io.swagger.client.auth.*;
     import io.swagger.client.model.*;
    @@ -2283,17 +2408,17 @@ public class CasappApiExample {
             CasappApi apiInstance = new CasappApi();
             String serviceUrl = serviceUrl_example; // String | Service URL to search
             try {
    -            CasApp result = apiInstance.findCasAppsByServiceUrl(serviceUrl);
    +            CasApp result = apiInstance.findCasAppByServiceUrl(serviceUrl);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling CasappApi#findCasAppsByServiceUrl");
    +            System.err.println("Exception when calling CasappApi#findCasAppByServiceUrl");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    import io.swagger.client.api.CasappApi;
     
     public class CasappApiExample {
    @@ -2302,26 +2427,26 @@ public class CasappApiExample {
             CasappApi apiInstance = new CasappApi();
             String serviceUrl = serviceUrl_example; // String | Service URL to search
             try {
    -            CasApp result = apiInstance.findCasAppsByServiceUrl(serviceUrl);
    +            CasApp result = apiInstance.findCasAppByServiceUrl(serviceUrl);
                 System.out.println(result);
             } catch (ApiException e) {
    -            System.err.println("Exception when calling CasappApi#findCasAppsByServiceUrl");
    +            System.err.println("Exception when calling CasappApi#findCasAppByServiceUrl");
                 e.printStackTrace();
             }
         }
     }
    -
    +
    String *serviceUrl = serviceUrl_example; // Service URL to search
     
     CasappApi *apiInstance = [[CasappApi alloc] init];
     
    -// Finds CAS applications by Service URL
    -[apiInstance findCasAppsByServiceUrlWith:serviceUrl
    +// Get CAS Application by Service URL
    +[apiInstance findCasAppByServiceUrlWith:serviceUrl
                   completionHandler: ^(CasApp output, NSError* error) {
                                 if (output) {
                                     NSLog(@"%@", output);
    @@ -2333,7 +2458,7 @@ CasappApi *apiInstance = [[CasappApi alloc] init];
     
    -
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
     
     var api = new LemonLdapngManagerApi.CasappApi()
    @@ -2346,14 +2471,14 @@ var callback = function(error, data, response) {
         console.log('API called successfully. Returned data: ' + data);
       }
     };
    -api.findCasAppsByServiceUrl(serviceUrl, callback);
    +api.findCasAppByServiceUrl(serviceUrl, callback);
     
    - -
    +
    using System;
     using System.Diagnostics;
     using IO.Swagger.Api;
    @@ -2362,7 +2487,7 @@ using IO.Swagger.Model;
     
     namespace Example
     {
    -    public class findCasAppsByServiceUrlExample
    +    public class findCasAppByServiceUrlExample
         {
             public void main()
             {
    @@ -2372,13 +2497,13 @@ namespace Example
     
                 try
                 {
    -                // Finds CAS applications by Service URL
    -                CasApp result = apiInstance.findCasAppsByServiceUrl(serviceUrl);
    +                // Get CAS Application by Service URL
    +                CasApp result = apiInstance.findCasAppByServiceUrl(serviceUrl);
                     Debug.WriteLine(result);
                 }
                 catch (Exception e)
                 {
    -                Debug.Print("Exception when calling CasappApi.findCasAppsByServiceUrl: " + e.Message );
    +                Debug.Print("Exception when calling CasappApi.findCasAppByServiceUrl: " + e.Message );
                 }
             }
         }
    @@ -2386,7 +2511,7 @@ namespace Example
     
    -
    +
    <?php
     require_once(__DIR__ . '/vendor/autoload.php');
     
    @@ -2394,15 +2519,15 @@ $api_instance = new Swagger\Client\ApiCasappApi();
     $serviceUrl = serviceUrl_example; // String | Service URL to search
     
     try {
    -    $result = $api_instance->findCasAppsByServiceUrl($serviceUrl);
    +    $result = $api_instance->findCasAppByServiceUrl($serviceUrl);
         print_r($result);
     } catch (Exception $e) {
    -    echo 'Exception when calling CasappApi->findCasAppsByServiceUrl: ', $e->getMessage(), PHP_EOL;
    +    echo 'Exception when calling CasappApi->findCasAppByServiceUrl: ', $e->getMessage(), PHP_EOL;
     }
     ?>
    -
    +
    use Data::Dumper;
     use WWW::SwaggerClient::Configuration;
     use WWW::SwaggerClient::CasappApi;
    @@ -2411,15 +2536,15 @@ my $api_instance = WWW::SwaggerClient::CasappApi->new();
     my $serviceUrl = serviceUrl_example; # String | Service URL to search
     
     eval { 
    -    my $result = $api_instance->findCasAppsByServiceUrl(serviceUrl => $serviceUrl);
    +    my $result = $api_instance->findCasAppByServiceUrl(serviceUrl => $serviceUrl);
         print Dumper($result);
     };
     if ($@) {
    -    warn "Exception when calling CasappApi->findCasAppsByServiceUrl: $@\n";
    +    warn "Exception when calling CasappApi->findCasAppByServiceUrl: $@\n";
     }
    -
    +
    from __future__ import print_statement
     import time
     import swagger_client
    @@ -2431,11 +2556,11 @@ api_instance = swagger_client.CasappApi()
     serviceUrl = serviceUrl_example # String | Service URL to search
     
     try: 
    -    # Finds CAS applications by Service URL
    -    api_response = api_instance.find_cas_apps_by_service_url(serviceUrl)
    +    # Get CAS Application by Service URL
    +    api_response = api_instance.find_cas_app_by_service_url(serviceUrl)
         pprint(api_response)
     except ApiException as e:
    -    print("Exception when calling CasappApi->findCasAppsByServiceUrl: %s\n" % e)
    + print("Exception when calling CasappApi->findCasAppByServiceUrl: %s\n" % e)
    @@ -2455,7 +2580,7 @@ except ApiException as e: -
    +
    @@ -2480,14 +2605,14 @@ except ApiException as e:
    -
    -
    +
    +
    - +
    @@ -2528,14 +2653,14 @@ except ApiException as e:
    -
    -
    +
    +
    - + +
    +
    + +

    Status: 404 - The specified resource was not found

    + + + +
    +
    +
    + +
    +
    @@ -5850,6 +6023,5284 @@ except ApiException as e:

    +
    +

    Menuapp

    +
    +
    +
    +

    addMenuApp

    +

    Create a new Menu Application within a Menu Category

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/app/{cat}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "/api/v1/api/v1/menu/app/{cat}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenuappApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenuappApi apiInstance = new MenuappApi();
    +        MenuApp body = ; // MenuApp | Menu Application to add
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        try {
    +            apiInstance.addMenuApp(body, cat);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#addMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenuappApi;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        MenuappApi apiInstance = new MenuappApi();
    +        MenuApp body = ; // MenuApp | Menu Application to add
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        try {
    +            apiInstance.addMenuApp(body, cat);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#addMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    MenuApp *body = ; // Menu Application to add
    +menuCatConfKey *cat = ; // Configuration key of Menu Category to work with
    +
    +MenuappApi *apiInstance = [[MenuappApi alloc] init];
    +
    +// Create a new Menu Application within a Menu Category
    +[apiInstance addMenuAppWith:body
    +    cat:cat
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenuappApi()
    +var body = ; // {{MenuApp}} Menu Application to add
    +var cat = ; // {{menuCatConfKey}} Configuration key of Menu Category to work with
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.addMenuApp(bodycat, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class addMenuAppExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenuappApi();
    +            var body = new MenuApp(); // MenuApp | Menu Application to add
    +            var cat = new menuCatConfKey(); // menuCatConfKey | Configuration key of Menu Category to work with
    +
    +            try
    +            {
    +                // Create a new Menu Application within a Menu Category
    +                apiInstance.addMenuApp(body, cat);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenuappApi.addMenuApp: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenuappApi();
    +$body = ; // MenuApp | Menu Application to add
    +$cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +
    +try {
    +    $api_instance->addMenuApp($body, $cat);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenuappApi->addMenuApp: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenuappApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenuappApi->new();
    +my $body = WWW::SwaggerClient::Object::MenuApp->new(); # MenuApp | Menu Application to add
    +my $cat = ; # menuCatConfKey | Configuration key of Menu Category to work with
    +
    +eval { 
    +    $api_instance->addMenuApp(body => $body, cat => $cat);
    +};
    +if ($@) {
    +    warn "Exception when calling MenuappApi->addMenuApp: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenuappApi()
    +body =  # MenuApp | Menu Application to add
    +cat =  # menuCatConfKey | Configuration key of Menu Category to work with
    +
    +try: 
    +    # Create a new Menu Application within a Menu Category
    +    api_instance.add_menu_app(body, cat)
    +except ApiException as e:
    +    print("Exception when calling MenuappApi->addMenuApp: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + +
    NameDescription
    cat* + + +
    +
    +
    + + menuCatConfKey + + +
    + Configuration key of Menu Category to work with +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + +
    NameDescription
    body * + + + +
    +
    + + + +

    Responses

    +

    Status: 201 - Successful creation

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    Status: 409 - The specified object could not be created because its configuration key, client_id or entityID already exists

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

    deleteMenuApp

    +

    Deletes a Menu Application

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/app/{cat}/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE "/api/v1/api/v1/menu/app/{cat}/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenuappApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application to delete
    +        try {
    +            apiInstance.deleteMenuApp(cat, confKey);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#deleteMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenuappApi;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application to delete
    +        try {
    +            apiInstance.deleteMenuApp(cat, confKey);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#deleteMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    menuCatConfKey *cat = ; // Configuration key of Menu Category to work with
    +confKey *confKey = ; // Configuration key of Menu Application to delete
    +
    +MenuappApi *apiInstance = [[MenuappApi alloc] init];
    +
    +// Deletes a Menu Application
    +[apiInstance deleteMenuAppWith:cat
    +    confKey:confKey
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenuappApi()
    +var cat = ; // {{menuCatConfKey}} Configuration key of Menu Category to work with
    +var confKey = ; // {{confKey}} Configuration key of Menu Application to delete
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.deleteMenuApp(cat, confKey, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class deleteMenuAppExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenuappApi();
    +            var cat = new menuCatConfKey(); // menuCatConfKey | Configuration key of Menu Category to work with
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Application to delete
    +
    +            try
    +            {
    +                // Deletes a Menu Application
    +                apiInstance.deleteMenuApp(cat, confKey);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenuappApi.deleteMenuApp: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenuappApi();
    +$cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +$confKey = ; // confKey | Configuration key of Menu Application to delete
    +
    +try {
    +    $api_instance->deleteMenuApp($cat, $confKey);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenuappApi->deleteMenuApp: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenuappApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenuappApi->new();
    +my $cat = ; # menuCatConfKey | Configuration key of Menu Category to work with
    +my $confKey = ; # confKey | Configuration key of Menu Application to delete
    +
    +eval { 
    +    $api_instance->deleteMenuApp(cat => $cat, confKey => $confKey);
    +};
    +if ($@) {
    +    warn "Exception when calling MenuappApi->deleteMenuApp: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenuappApi()
    +cat =  # menuCatConfKey | Configuration key of Menu Category to work with
    +confKey =  # confKey | Configuration key of Menu Application to delete
    +
    +try: 
    +    # Deletes a Menu Application
    +    api_instance.delete_menu_app(cat, confKey)
    +except ApiException as e:
    +    print("Exception when calling MenuappApi->deleteMenuApp: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + + + +
    NameDescription
    cat* + + +
    +
    +
    + + menuCatConfKey + + +
    + Configuration key of Menu Category to work with +
    +
    +
    + Required +
    +
    +
    +
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Application to delete +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 204 - Successful modification

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    findMenuAppByConfKey

    +

    Finds Menu Applications by configuration key within a Menu Category

    +
    +
    +
    +

    +

    Takes a search pattern to be tested against existing applications within a menu category

    +

    +
    +
    /api/v1/menu/app/{cat}/findByConfKey
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "/api/v1/api/v1/menu/app/{cat}/findByConfKey?pattern="
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenuappApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        String pattern = pattern_example; // String | Search pattern
    +        try {
    +            array[MenuApp] result = apiInstance.findMenuAppByConfKey(cat, pattern);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#findMenuAppByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenuappApi;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        String pattern = pattern_example; // String | Search pattern
    +        try {
    +            array[MenuApp] result = apiInstance.findMenuAppByConfKey(cat, pattern);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#findMenuAppByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    menuCatConfKey *cat = ; // Configuration key of Menu Category to work with
    +String *pattern = pattern_example; // Search pattern
    +
    +MenuappApi *apiInstance = [[MenuappApi alloc] init];
    +
    +// Finds Menu Applications by configuration key within a Menu Category
    +[apiInstance findMenuAppByConfKeyWith:cat
    +    pattern:pattern
    +              completionHandler: ^(array[MenuApp] output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenuappApi()
    +var cat = ; // {{menuCatConfKey}} Configuration key of Menu Category to work with
    +var pattern = pattern_example; // {{String}} Search pattern
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.findMenuAppByConfKey(cat, pattern, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class findMenuAppByConfKeyExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenuappApi();
    +            var cat = new menuCatConfKey(); // menuCatConfKey | Configuration key of Menu Category to work with
    +            var pattern = pattern_example;  // String | Search pattern
    +
    +            try
    +            {
    +                // Finds Menu Applications by configuration key within a Menu Category
    +                array[MenuApp] result = apiInstance.findMenuAppByConfKey(cat, pattern);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenuappApi.findMenuAppByConfKey: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenuappApi();
    +$cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +$pattern = pattern_example; // String | Search pattern
    +
    +try {
    +    $result = $api_instance->findMenuAppByConfKey($cat, $pattern);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenuappApi->findMenuAppByConfKey: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenuappApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenuappApi->new();
    +my $cat = ; # menuCatConfKey | Configuration key of Menu Category to work with
    +my $pattern = pattern_example; # String | Search pattern
    +
    +eval { 
    +    my $result = $api_instance->findMenuAppByConfKey(cat => $cat, pattern => $pattern);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling MenuappApi->findMenuAppByConfKey: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenuappApi()
    +cat =  # menuCatConfKey | Configuration key of Menu Category to work with
    +pattern = pattern_example # String | Search pattern
    +
    +try: 
    +    # Finds Menu Applications by configuration key within a Menu Category
    +    api_response = api_instance.find_menu_app_by_conf_key(cat, pattern)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling MenuappApi->findMenuAppByConfKey: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + +
    NameDescription
    cat* + + +
    +
    +
    + + menuCatConfKey + + +
    + Configuration key of Menu Category to work with +
    +
    +
    + Required +
    +
    +
    +
    + + + + +
    Query parameters
    + + + + + + + + +
    NameDescription
    pattern* + + +
    +
    +
    + + String + + +
    + Search pattern +
    +
    +
    + Required +
    +
    +
    +
    + +

    Responses

    +

    Status: 200 - Return a list of Menu Applications

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

    Status: 400 - An error was encountered when processing the request

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

    getMenuAppByConfKey

    +

    Get Menu Application within a Menu Category by configuration key

    +
    +
    +
    +

    +

    Returns a single application

    +

    +
    +
    /api/v1/menu/app/{cat}/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "/api/v1/api/v1/menu/app/{cat}/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenuappApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application
    +        try {
    +            MenuApp result = apiInstance.getMenuAppByConfKey(cat, confKey);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#getMenuAppByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenuappApi;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application
    +        try {
    +            MenuApp result = apiInstance.getMenuAppByConfKey(cat, confKey);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#getMenuAppByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    menuCatConfKey *cat = ; // Configuration key of Menu Category to work with
    +confKey *confKey = ; // Configuration key of Menu Application
    +
    +MenuappApi *apiInstance = [[MenuappApi alloc] init];
    +
    +// Get Menu Application within a Menu Category by configuration key
    +[apiInstance getMenuAppByConfKeyWith:cat
    +    confKey:confKey
    +              completionHandler: ^(MenuApp output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenuappApi()
    +var cat = ; // {{menuCatConfKey}} Configuration key of Menu Category to work with
    +var confKey = ; // {{confKey}} Configuration key of Menu Application
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getMenuAppByConfKey(cat, confKey, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class getMenuAppByConfKeyExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenuappApi();
    +            var cat = new menuCatConfKey(); // menuCatConfKey | Configuration key of Menu Category to work with
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Application
    +
    +            try
    +            {
    +                // Get Menu Application within a Menu Category by configuration key
    +                MenuApp result = apiInstance.getMenuAppByConfKey(cat, confKey);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenuappApi.getMenuAppByConfKey: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenuappApi();
    +$cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +$confKey = ; // confKey | Configuration key of Menu Application
    +
    +try {
    +    $result = $api_instance->getMenuAppByConfKey($cat, $confKey);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenuappApi->getMenuAppByConfKey: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenuappApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenuappApi->new();
    +my $cat = ; # menuCatConfKey | Configuration key of Menu Category to work with
    +my $confKey = ; # confKey | Configuration key of Menu Application
    +
    +eval { 
    +    my $result = $api_instance->getMenuAppByConfKey(cat => $cat, confKey => $confKey);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling MenuappApi->getMenuAppByConfKey: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenuappApi()
    +cat =  # menuCatConfKey | Configuration key of Menu Category to work with
    +confKey =  # confKey | Configuration key of Menu Application
    +
    +try: 
    +    # Get Menu Application within a Menu Category by configuration key
    +    api_response = api_instance.get_menu_app_by_conf_key(cat, confKey)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling MenuappApi->getMenuAppByConfKey: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + + + +
    NameDescription
    cat* + + +
    +
    +
    + + menuCatConfKey + + +
    + Configuration key of Menu Category to work with +
    +
    +
    + Required +
    +
    +
    +
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Application +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - Return a Menu Application

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

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    getMenuApps

    +

    Get Menu Applications within a Menu Category

    +
    +
    +
    +

    +

    Return existing applications within a menu category

    +

    +
    +
    /api/v1/menu/app/{cat}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "/api/v1/api/v1/menu/app/{cat}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenuappApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        try {
    +            array[MenuApp] result = apiInstance.getMenuApps(cat);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#getMenuApps");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenuappApi;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        try {
    +            array[MenuApp] result = apiInstance.getMenuApps(cat);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#getMenuApps");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    menuCatConfKey *cat = ; // Configuration key of Menu Category to work with
    +
    +MenuappApi *apiInstance = [[MenuappApi alloc] init];
    +
    +// Get Menu Applications within a Menu Category
    +[apiInstance getMenuAppsWith:cat
    +              completionHandler: ^(array[MenuApp] output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenuappApi()
    +var cat = ; // {{menuCatConfKey}} Configuration key of Menu Category to work with
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getMenuApps(cat, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class getMenuAppsExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenuappApi();
    +            var cat = new menuCatConfKey(); // menuCatConfKey | Configuration key of Menu Category to work with
    +
    +            try
    +            {
    +                // Get Menu Applications within a Menu Category
    +                array[MenuApp] result = apiInstance.getMenuApps(cat);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenuappApi.getMenuApps: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenuappApi();
    +$cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +
    +try {
    +    $result = $api_instance->getMenuApps($cat);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenuappApi->getMenuApps: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenuappApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenuappApi->new();
    +my $cat = ; # menuCatConfKey | Configuration key of Menu Category to work with
    +
    +eval { 
    +    my $result = $api_instance->getMenuApps(cat => $cat);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling MenuappApi->getMenuApps: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenuappApi()
    +cat =  # menuCatConfKey | Configuration key of Menu Category to work with
    +
    +try: 
    +    # Get Menu Applications within a Menu Category
    +    api_response = api_instance.get_menu_apps(cat)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling MenuappApi->getMenuApps: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + +
    NameDescription
    cat* + + +
    +
    +
    + + menuCatConfKey + + +
    + Configuration key of Menu Category to work with +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - Return a list of Menu Applications

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

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    replaceMenuApp

    +

    Replaces a Menu Application

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/app/{cat}/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "/api/v1/api/v1/menu/app/{cat}/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenuappApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application that needs to be replaced
    +        MenuApp body = ; // MenuApp | 
    +        try {
    +            apiInstance.replaceMenuApp(cat, confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#replaceMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenuappApi;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application that needs to be replaced
    +        MenuApp body = ; // MenuApp | 
    +        try {
    +            apiInstance.replaceMenuApp(cat, confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#replaceMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    menuCatConfKey *cat = ; // Configuration key of Menu Category to work with
    +confKey *confKey = ; // Configuration key of Menu Application that needs to be replaced
    +MenuApp *body = ; //  (optional)
    +
    +MenuappApi *apiInstance = [[MenuappApi alloc] init];
    +
    +// Replaces a Menu Application
    +[apiInstance replaceMenuAppWith:cat
    +    confKey:confKey
    +    body:body
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenuappApi()
    +var cat = ; // {{menuCatConfKey}} Configuration key of Menu Category to work with
    +var confKey = ; // {{confKey}} Configuration key of Menu Application that needs to be replaced
    +var opts = { 
    +  'body':  // {{MenuApp}} 
    +};
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.replaceMenuApp(catconfKey, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class replaceMenuAppExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenuappApi();
    +            var cat = new menuCatConfKey(); // menuCatConfKey | Configuration key of Menu Category to work with
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Application that needs to be replaced
    +            var body = new MenuApp(); // MenuApp |  (optional) 
    +
    +            try
    +            {
    +                // Replaces a Menu Application
    +                apiInstance.replaceMenuApp(cat, confKey, body);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenuappApi.replaceMenuApp: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenuappApi();
    +$cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +$confKey = ; // confKey | Configuration key of Menu Application that needs to be replaced
    +$body = ; // MenuApp | 
    +
    +try {
    +    $api_instance->replaceMenuApp($cat, $confKey, $body);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenuappApi->replaceMenuApp: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenuappApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenuappApi->new();
    +my $cat = ; # menuCatConfKey | Configuration key of Menu Category to work with
    +my $confKey = ; # confKey | Configuration key of Menu Application that needs to be replaced
    +my $body = WWW::SwaggerClient::Object::MenuApp->new(); # MenuApp | 
    +
    +eval { 
    +    $api_instance->replaceMenuApp(cat => $cat, confKey => $confKey, body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling MenuappApi->replaceMenuApp: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenuappApi()
    +cat =  # menuCatConfKey | Configuration key of Menu Category to work with
    +confKey =  # confKey | Configuration key of Menu Application that needs to be replaced
    +body =  # MenuApp |  (optional)
    +
    +try: 
    +    # Replaces a Menu Application
    +    api_instance.replace_menu_app(cat, confKey, body=body)
    +except ApiException as e:
    +    print("Exception when calling MenuappApi->replaceMenuApp: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + + + +
    NameDescription
    cat* + + +
    +
    +
    + + menuCatConfKey + + +
    + Configuration key of Menu Category to work with +
    +
    +
    + Required +
    +
    +
    +
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Application that needs to be replaced +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + +
    NameDescription
    body + + + +
    +
    + + + +

    Responses

    +

    Status: 204 - Successful modification

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    Status: 409 - The specified object could not be created because its configuration key, client_id or entityID already exists

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

    updateMenuApp

    +

    Updates a Menu Application

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/app/{cat}/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PATCH "/api/v1/api/v1/menu/app/{cat}/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenuappApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application that needs to be updated
    +        MenuAppUpdate body = ; // MenuAppUpdate | 
    +        try {
    +            apiInstance.updateMenuApp(cat, confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#updateMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenuappApi;
    +
    +public class MenuappApiExample {
    +
    +    public static void main(String[] args) {
    +        MenuappApi apiInstance = new MenuappApi();
    +        menuCatConfKey cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +        confKey confKey = ; // confKey | Configuration key of Menu Application that needs to be updated
    +        MenuAppUpdate body = ; // MenuAppUpdate | 
    +        try {
    +            apiInstance.updateMenuApp(cat, confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenuappApi#updateMenuApp");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    menuCatConfKey *cat = ; // Configuration key of Menu Category to work with
    +confKey *confKey = ; // Configuration key of Menu Application that needs to be updated
    +MenuAppUpdate *body = ; //  (optional)
    +
    +MenuappApi *apiInstance = [[MenuappApi alloc] init];
    +
    +// Updates a Menu Application
    +[apiInstance updateMenuAppWith:cat
    +    confKey:confKey
    +    body:body
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenuappApi()
    +var cat = ; // {{menuCatConfKey}} Configuration key of Menu Category to work with
    +var confKey = ; // {{confKey}} Configuration key of Menu Application that needs to be updated
    +var opts = { 
    +  'body':  // {{MenuAppUpdate}} 
    +};
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.updateMenuApp(catconfKey, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class updateMenuAppExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenuappApi();
    +            var cat = new menuCatConfKey(); // menuCatConfKey | Configuration key of Menu Category to work with
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Application that needs to be updated
    +            var body = new MenuAppUpdate(); // MenuAppUpdate |  (optional) 
    +
    +            try
    +            {
    +                // Updates a Menu Application
    +                apiInstance.updateMenuApp(cat, confKey, body);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenuappApi.updateMenuApp: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenuappApi();
    +$cat = ; // menuCatConfKey | Configuration key of Menu Category to work with
    +$confKey = ; // confKey | Configuration key of Menu Application that needs to be updated
    +$body = ; // MenuAppUpdate | 
    +
    +try {
    +    $api_instance->updateMenuApp($cat, $confKey, $body);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenuappApi->updateMenuApp: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenuappApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenuappApi->new();
    +my $cat = ; # menuCatConfKey | Configuration key of Menu Category to work with
    +my $confKey = ; # confKey | Configuration key of Menu Application that needs to be updated
    +my $body = WWW::SwaggerClient::Object::MenuAppUpdate->new(); # MenuAppUpdate | 
    +
    +eval { 
    +    $api_instance->updateMenuApp(cat => $cat, confKey => $confKey, body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling MenuappApi->updateMenuApp: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenuappApi()
    +cat =  # menuCatConfKey | Configuration key of Menu Category to work with
    +confKey =  # confKey | Configuration key of Menu Application that needs to be updated
    +body =  # MenuAppUpdate |  (optional)
    +
    +try: 
    +    # Updates a Menu Application
    +    api_instance.update_menu_app(cat, confKey, body=body)
    +except ApiException as e:
    +    print("Exception when calling MenuappApi->updateMenuApp: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + + + + +
    NameDescription
    cat* + + +
    +
    +
    + + menuCatConfKey + + +
    + Configuration key of Menu Category to work with +
    +
    +
    + Required +
    +
    +
    +
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Application that needs to be updated +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + +
    NameDescription
    body + + + +
    +
    + + + +

    Responses

    +

    Status: 204 - Successful modification

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    Status: 409 - The specified object could not be created because its configuration key, client_id or entityID already exists

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

    Menucat

    +
    +
    +
    +

    addMenuCat

    +

    Create a new Menu Category

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/cat
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X POST "/api/v1/api/v1/menu/cat"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenucatApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenucatApi apiInstance = new MenucatApi();
    +        MenuCat body = ; // MenuCat | Menu Category to add
    +        try {
    +            apiInstance.addMenuCat(body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#addMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenucatApi;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        MenucatApi apiInstance = new MenucatApi();
    +        MenuCat body = ; // MenuCat | Menu Category to add
    +        try {
    +            apiInstance.addMenuCat(body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#addMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    MenuCat *body = ; // Menu Category to add
    +
    +MenucatApi *apiInstance = [[MenucatApi alloc] init];
    +
    +// Create a new Menu Category
    +[apiInstance addMenuCatWith:body
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenucatApi()
    +var body = ; // {{MenuCat}} Menu Category to add
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.addMenuCat(body, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class addMenuCatExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenucatApi();
    +            var body = new MenuCat(); // MenuCat | Menu Category to add
    +
    +            try
    +            {
    +                // Create a new Menu Category
    +                apiInstance.addMenuCat(body);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenucatApi.addMenuCat: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenucatApi();
    +$body = ; // MenuCat | Menu Category to add
    +
    +try {
    +    $api_instance->addMenuCat($body);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenucatApi->addMenuCat: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenucatApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenucatApi->new();
    +my $body = WWW::SwaggerClient::Object::MenuCat->new(); # MenuCat | Menu Category to add
    +
    +eval { 
    +    $api_instance->addMenuCat(body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling MenucatApi->addMenuCat: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenucatApi()
    +body =  # MenuCat | Menu Category to add
    +
    +try: 
    +    # Create a new Menu Category
    +    api_instance.add_menu_cat(body)
    +except ApiException as e:
    +    print("Exception when calling MenucatApi->addMenuCat: %s\n" % e)
    +
    +
    + +

    Parameters

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

    Responses

    +

    Status: 201 - Successful creation

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 409 - The specified object could not be created because its configuration key, client_id or entityID already exists

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

    deleteMenuCat

    +

    Deletes a Menu Category

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/cat/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X DELETE "/api/v1/api/v1/menu/cat/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenucatApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category to delete
    +        try {
    +            apiInstance.deleteMenuCat(confKey);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#deleteMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenucatApi;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category to delete
    +        try {
    +            apiInstance.deleteMenuCat(confKey);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#deleteMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    confKey *confKey = ; // Configuration key of Menu Category to delete
    +
    +MenucatApi *apiInstance = [[MenucatApi alloc] init];
    +
    +// Deletes a Menu Category
    +[apiInstance deleteMenuCatWith:confKey
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenucatApi()
    +var confKey = ; // {{confKey}} Configuration key of Menu Category to delete
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.deleteMenuCat(confKey, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class deleteMenuCatExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenucatApi();
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Category to delete
    +
    +            try
    +            {
    +                // Deletes a Menu Category
    +                apiInstance.deleteMenuCat(confKey);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenucatApi.deleteMenuCat: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenucatApi();
    +$confKey = ; // confKey | Configuration key of Menu Category to delete
    +
    +try {
    +    $api_instance->deleteMenuCat($confKey);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenucatApi->deleteMenuCat: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenucatApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenucatApi->new();
    +my $confKey = ; # confKey | Configuration key of Menu Category to delete
    +
    +eval { 
    +    $api_instance->deleteMenuCat(confKey => $confKey);
    +};
    +if ($@) {
    +    warn "Exception when calling MenucatApi->deleteMenuCat: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenucatApi()
    +confKey =  # confKey | Configuration key of Menu Category to delete
    +
    +try: 
    +    # Deletes a Menu Category
    +    api_instance.delete_menu_cat(confKey)
    +except ApiException as e:
    +    print("Exception when calling MenucatApi->deleteMenuCat: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + +
    NameDescription
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Category to delete +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 204 - Successful modification

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    findMenuCatByConfKey

    +

    Finds Menu Categories by configuration key

    +
    +
    +
    +

    +

    Takes a search pattern to be tested against existing categories

    +

    +
    +
    /api/v1/menu/cat/findByConfKey
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "/api/v1/api/v1/menu/cat/findByConfKey?pattern="
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenucatApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenucatApi apiInstance = new MenucatApi();
    +        String pattern = pattern_example; // String | Search pattern
    +        try {
    +            array[MenuCat] result = apiInstance.findMenuCatByConfKey(pattern);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#findMenuCatByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenucatApi;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        MenucatApi apiInstance = new MenucatApi();
    +        String pattern = pattern_example; // String | Search pattern
    +        try {
    +            array[MenuCat] result = apiInstance.findMenuCatByConfKey(pattern);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#findMenuCatByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    String *pattern = pattern_example; // Search pattern
    +
    +MenucatApi *apiInstance = [[MenucatApi alloc] init];
    +
    +// Finds Menu Categories by configuration key
    +[apiInstance findMenuCatByConfKeyWith:pattern
    +              completionHandler: ^(array[MenuCat] output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenucatApi()
    +var pattern = pattern_example; // {{String}} Search pattern
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.findMenuCatByConfKey(pattern, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class findMenuCatByConfKeyExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenucatApi();
    +            var pattern = pattern_example;  // String | Search pattern
    +
    +            try
    +            {
    +                // Finds Menu Categories by configuration key
    +                array[MenuCat] result = apiInstance.findMenuCatByConfKey(pattern);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenucatApi.findMenuCatByConfKey: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenucatApi();
    +$pattern = pattern_example; // String | Search pattern
    +
    +try {
    +    $result = $api_instance->findMenuCatByConfKey($pattern);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenucatApi->findMenuCatByConfKey: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenucatApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenucatApi->new();
    +my $pattern = pattern_example; # String | Search pattern
    +
    +eval { 
    +    my $result = $api_instance->findMenuCatByConfKey(pattern => $pattern);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling MenucatApi->findMenuCatByConfKey: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenucatApi()
    +pattern = pattern_example # String | Search pattern
    +
    +try: 
    +    # Finds Menu Categories by configuration key
    +    api_response = api_instance.find_menu_cat_by_conf_key(pattern)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling MenucatApi->findMenuCatByConfKey: %s\n" % e)
    +
    +
    + +

    Parameters

    + + + + + +
    Query parameters
    + + + + + + + + +
    NameDescription
    pattern* + + +
    +
    +
    + + String + + +
    + Search pattern +
    +
    +
    + Required +
    +
    +
    +
    + +

    Responses

    +

    Status: 200 - Return a list of Menu Categories

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

    Status: 400 - An error was encountered when processing the request

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

    getMenuCatByConfKey

    +

    Get Menu Category by configuration key

    +
    +
    +
    +

    +

    Returns a single Category

    +

    +
    +
    /api/v1/menu/cat/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X GET "/api/v1/api/v1/menu/cat/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenucatApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category
    +        try {
    +            MenuCat result = apiInstance.getMenuCatByConfKey(confKey);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#getMenuCatByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenucatApi;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category
    +        try {
    +            MenuCat result = apiInstance.getMenuCatByConfKey(confKey);
    +            System.out.println(result);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#getMenuCatByConfKey");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    confKey *confKey = ; // Configuration key of Menu Category
    +
    +MenucatApi *apiInstance = [[MenucatApi alloc] init];
    +
    +// Get Menu Category by configuration key
    +[apiInstance getMenuCatByConfKeyWith:confKey
    +              completionHandler: ^(MenuCat output, NSError* error) {
    +                            if (output) {
    +                                NSLog(@"%@", output);
    +                            }
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenucatApi()
    +var confKey = ; // {{confKey}} Configuration key of Menu Category
    +
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully. Returned data: ' + data);
    +  }
    +};
    +api.getMenuCatByConfKey(confKey, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class getMenuCatByConfKeyExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenucatApi();
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Category
    +
    +            try
    +            {
    +                // Get Menu Category by configuration key
    +                MenuCat result = apiInstance.getMenuCatByConfKey(confKey);
    +                Debug.WriteLine(result);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenucatApi.getMenuCatByConfKey: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenucatApi();
    +$confKey = ; // confKey | Configuration key of Menu Category
    +
    +try {
    +    $result = $api_instance->getMenuCatByConfKey($confKey);
    +    print_r($result);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenucatApi->getMenuCatByConfKey: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenucatApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenucatApi->new();
    +my $confKey = ; # confKey | Configuration key of Menu Category
    +
    +eval { 
    +    my $result = $api_instance->getMenuCatByConfKey(confKey => $confKey);
    +    print Dumper($result);
    +};
    +if ($@) {
    +    warn "Exception when calling MenucatApi->getMenuCatByConfKey: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenucatApi()
    +confKey =  # confKey | Configuration key of Menu Category
    +
    +try: 
    +    # Get Menu Category by configuration key
    +    api_response = api_instance.get_menu_cat_by_conf_key(confKey)
    +    pprint(api_response)
    +except ApiException as e:
    +    print("Exception when calling MenucatApi->getMenuCatByConfKey: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + +
    NameDescription
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Category +
    +
    +
    + Required +
    +
    +
    +
    + + + + + +

    Responses

    +

    Status: 200 - Return a Menu Category

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

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    replaceMenuCat

    +

    Replaces a Menu Category

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/cat/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PUT "/api/v1/api/v1/menu/cat/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenucatApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category that needs to be replaced
    +        MenuCat body = ; // MenuCat | 
    +        try {
    +            apiInstance.replaceMenuCat(confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#replaceMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenucatApi;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category that needs to be replaced
    +        MenuCat body = ; // MenuCat | 
    +        try {
    +            apiInstance.replaceMenuCat(confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#replaceMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    confKey *confKey = ; // Configuration key of Menu Category that needs to be replaced
    +MenuCat *body = ; //  (optional)
    +
    +MenucatApi *apiInstance = [[MenucatApi alloc] init];
    +
    +// Replaces a Menu Category
    +[apiInstance replaceMenuCatWith:confKey
    +    body:body
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenucatApi()
    +var confKey = ; // {{confKey}} Configuration key of Menu Category that needs to be replaced
    +var opts = { 
    +  'body':  // {{MenuCat}} 
    +};
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.replaceMenuCat(confKey, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class replaceMenuCatExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenucatApi();
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Category that needs to be replaced
    +            var body = new MenuCat(); // MenuCat |  (optional) 
    +
    +            try
    +            {
    +                // Replaces a Menu Category
    +                apiInstance.replaceMenuCat(confKey, body);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenucatApi.replaceMenuCat: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenucatApi();
    +$confKey = ; // confKey | Configuration key of Menu Category that needs to be replaced
    +$body = ; // MenuCat | 
    +
    +try {
    +    $api_instance->replaceMenuCat($confKey, $body);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenucatApi->replaceMenuCat: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenucatApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenucatApi->new();
    +my $confKey = ; # confKey | Configuration key of Menu Category that needs to be replaced
    +my $body = WWW::SwaggerClient::Object::MenuCat->new(); # MenuCat | 
    +
    +eval { 
    +    $api_instance->replaceMenuCat(confKey => $confKey, body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling MenucatApi->replaceMenuCat: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenucatApi()
    +confKey =  # confKey | Configuration key of Menu Category that needs to be replaced
    +body =  # MenuCat |  (optional)
    +
    +try: 
    +    # Replaces a Menu Category
    +    api_instance.replace_menu_cat(confKey, body=body)
    +except ApiException as e:
    +    print("Exception when calling MenucatApi->replaceMenuCat: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + +
    NameDescription
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Category that needs to be replaced +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + +
    NameDescription
    body + + + +
    +
    + + + +

    Responses

    +

    Status: 204 - Successful modification

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    Status: 409 - The specified object could not be created because its configuration key, client_id or entityID already exists

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

    updateMenuCat

    +

    Updates a Menu Category

    +
    +
    +
    +

    +

    +

    +
    +
    /api/v1/menu/cat/{confKey}
    +

    +

    Usage and SDK Samples

    +

    + + +
    +
    +
    curl -X PATCH "/api/v1/api/v1/menu/cat/{confKey}"
    +
    +
    +
    import io.swagger.client.*;
    +import io.swagger.client.auth.*;
    +import io.swagger.client.model.*;
    +import io.swagger.client.api.MenucatApi;
    +
    +import java.io.File;
    +import java.util.*;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category that needs to be updated
    +        MenuCatUpdate body = ; // MenuCatUpdate | 
    +        try {
    +            apiInstance.updateMenuCat(confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#updateMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    import io.swagger.client.api.MenucatApi;
    +
    +public class MenucatApiExample {
    +
    +    public static void main(String[] args) {
    +        MenucatApi apiInstance = new MenucatApi();
    +        confKey confKey = ; // confKey | Configuration key of Menu Category that needs to be updated
    +        MenuCatUpdate body = ; // MenuCatUpdate | 
    +        try {
    +            apiInstance.updateMenuCat(confKey, body);
    +        } catch (ApiException e) {
    +            System.err.println("Exception when calling MenucatApi#updateMenuCat");
    +            e.printStackTrace();
    +        }
    +    }
    +}
    +
    + +
    +
    confKey *confKey = ; // Configuration key of Menu Category that needs to be updated
    +MenuCatUpdate *body = ; //  (optional)
    +
    +MenucatApi *apiInstance = [[MenucatApi alloc] init];
    +
    +// Updates a Menu Category
    +[apiInstance updateMenuCatWith:confKey
    +    body:body
    +              completionHandler: ^(NSError* error) {
    +                            if (error) {
    +                                NSLog(@"Error: %@", error);
    +                            }
    +                        }];
    +
    +
    + +
    +
    var LemonLdapngManagerApi = require('lemon_ldapng_manager_api');
    +
    +var api = new LemonLdapngManagerApi.MenucatApi()
    +var confKey = ; // {{confKey}} Configuration key of Menu Category that needs to be updated
    +var opts = { 
    +  'body':  // {{MenuCatUpdate}} 
    +};
    +var callback = function(error, data, response) {
    +  if (error) {
    +    console.error(error);
    +  } else {
    +    console.log('API called successfully.');
    +  }
    +};
    +api.updateMenuCat(confKey, opts, callback);
    +
    +
    + + +
    +
    using System;
    +using System.Diagnostics;
    +using IO.Swagger.Api;
    +using IO.Swagger.Client;
    +using IO.Swagger.Model;
    +
    +namespace Example
    +{
    +    public class updateMenuCatExample
    +    {
    +        public void main()
    +        {
    +
    +            var apiInstance = new MenucatApi();
    +            var confKey = new confKey(); // confKey | Configuration key of Menu Category that needs to be updated
    +            var body = new MenuCatUpdate(); // MenuCatUpdate |  (optional) 
    +
    +            try
    +            {
    +                // Updates a Menu Category
    +                apiInstance.updateMenuCat(confKey, body);
    +            }
    +            catch (Exception e)
    +            {
    +                Debug.Print("Exception when calling MenucatApi.updateMenuCat: " + e.Message );
    +            }
    +        }
    +    }
    +}
    +
    +
    + +
    +
    <?php
    +require_once(__DIR__ . '/vendor/autoload.php');
    +
    +$api_instance = new Swagger\Client\ApiMenucatApi();
    +$confKey = ; // confKey | Configuration key of Menu Category that needs to be updated
    +$body = ; // MenuCatUpdate | 
    +
    +try {
    +    $api_instance->updateMenuCat($confKey, $body);
    +} catch (Exception $e) {
    +    echo 'Exception when calling MenucatApi->updateMenuCat: ', $e->getMessage(), PHP_EOL;
    +}
    +?>
    +
    + +
    +
    use Data::Dumper;
    +use WWW::SwaggerClient::Configuration;
    +use WWW::SwaggerClient::MenucatApi;
    +
    +my $api_instance = WWW::SwaggerClient::MenucatApi->new();
    +my $confKey = ; # confKey | Configuration key of Menu Category that needs to be updated
    +my $body = WWW::SwaggerClient::Object::MenuCatUpdate->new(); # MenuCatUpdate | 
    +
    +eval { 
    +    $api_instance->updateMenuCat(confKey => $confKey, body => $body);
    +};
    +if ($@) {
    +    warn "Exception when calling MenucatApi->updateMenuCat: $@\n";
    +}
    +
    + +
    +
    from __future__ import print_statement
    +import time
    +import swagger_client
    +from swagger_client.rest import ApiException
    +from pprint import pprint
    +
    +# create an instance of the API class
    +api_instance = swagger_client.MenucatApi()
    +confKey =  # confKey | Configuration key of Menu Category that needs to be updated
    +body =  # MenuCatUpdate |  (optional)
    +
    +try: 
    +    # Updates a Menu Category
    +    api_instance.update_menu_cat(confKey, body=body)
    +except ApiException as e:
    +    print("Exception when calling MenucatApi->updateMenuCat: %s\n" % e)
    +
    +
    + +

    Parameters

    + +
    Path parameters
    + + + + + + + + +
    NameDescription
    confKey* + + +
    +
    +
    + + confKey + + +
    + Configuration key of Menu Category that needs to be updated +
    +
    +
    + Required +
    +
    +
    +
    + + +
    Body parameters
    + + + + + + + + +
    NameDescription
    body + + + +
    +
    + + + +

    Responses

    +

    Status: 204 - Successful modification

    + + + +
    +
    + +

    Status: 400 - An error was encountered when processing the request

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

    Status: 404 - The specified resource was not found

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

    Status: 409 - The specified object could not be created because its configuration key, client_id or entityID already exists

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

    Oidcrp

    diff --git a/doc/sources/manager-api/openapi-spec.yaml b/doc/sources/manager-api/openapi-spec.yaml index 7ddd306fd..bbf1ea11b 100644 --- a/doc/sources/manager-api/openapi-spec.yaml +++ b/doc/sources/manager-api/openapi-spec.yaml @@ -622,6 +622,357 @@ paths: 404: $ref: '#/components/responses/NotFound' + /api/v1/menu/cat: + post: + tags: + - menucat + summary: Create a new Menu Category + operationId: addMenuCat + requestBody: + description: Menu Category to add + content: + application/json: + schema: + $ref: '#/components/schemas/MenuCat' + required: true + responses: + 201: + $ref: '#/components/responses/Created' + 400: + $ref: '#/components/responses/Error' + 409: + $ref: '#/components/responses/Conflict' + + /api/v1/menu/cat/findByConfKey: + get: + tags: + - menucat + summary: Finds Menu Categories by configuration key + description: Takes a search pattern to be tested against existing categories + operationId: findMenuCatByConfKey + parameters: + - name: pattern + in: query + description: Search pattern + required: true + schema: + type: "string" + examples: + any: + summary: Any value + value: "*" + prefix: + summary: Given prefix + value: "zone1-*" + anywhere: + summary: Substring + value: "something" + responses: + 200: + $ref: '#/components/responses/ManyMenuCat' + 400: + $ref: '#/components/responses/Error' + + /api/v1/menu/cat/{confKey}: + get: + tags: + - menucat + summary: Get Menu Category by configuration key + description: Returns a single Category + operationId: getMenuCatByConfKey + parameters: + - name: confKey + in: path + description: Configuration key of Menu Category + required: true + schema: + $ref: '#/components/schemas/confKey' + responses: + 200: + $ref: '#/components/responses/OneMenuCat' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + + put: + tags: + - menucat + summary: Replaces a Menu Category + operationId: replaceMenuCat + parameters: + - name: confKey + in: path + description: Configuration key of Menu Category that needs to be replaced + required: true + schema: + $ref: '#/components/schemas/confKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MenuCat' + responses: + 204: + $ref: '#/components/responses/NoContent' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' + patch: + tags: + - menucat + summary: Updates a Menu Category + operationId: updateMenuCat + parameters: + - name: confKey + in: path + description: Configuration key of Menu Category that needs to be updated + required: true + schema: + $ref: '#/components/schemas/confKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MenuCatUpdate' + responses: + 204: + $ref: '#/components/responses/NoContent' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' + + delete: + tags: + - menucat + summary: Deletes a Menu Category + operationId: deleteMenuCat + parameters: + - name: confKey + in: path + description: Configuration key of Menu Category to delete + required: true + schema: + $ref: '#/components/schemas/confKey' + responses: + 204: + $ref: '#/components/responses/NoContent' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + + /api/v1/menu/app/{cat}: + get: + tags: + - menuapp + summary: Get Menu Applications within a Menu Category + description: Return existing applications within a menu category + operationId: getMenuApps + parameters: + - name: cat + in: path + description: Configuration key of Menu Category to work with + required: true + schema: + $ref: '#/components/schemas/menuCatConfKey' + responses: + 200: + $ref: '#/components/responses/ManyMenuApp' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + post: + tags: + - menuapp + summary: Create a new Menu Application within a Menu Category + operationId: addMenuApp + parameters: + - name: cat + in: path + description: Configuration key of Menu Category to work with + required: true + schema: + $ref: '#/components/schemas/menuCatConfKey' + requestBody: + description: Menu Application to add + content: + application/json: + schema: + $ref: '#/components/schemas/MenuApp' + required: true + responses: + 201: + $ref: '#/components/responses/Created' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' + + /api/v1/menu/app/{cat}/findByConfKey: + get: + tags: + - menuapp + summary: Finds Menu Applications by configuration key within a Menu Category + description: Takes a search pattern to be tested against existing applications within a menu category + operationId: findMenuAppByConfKey + parameters: + - name: cat + in: path + description: Configuration key of Menu Category to work with + required: true + schema: + $ref: '#/components/schemas/menuCatConfKey' + - name: pattern + in: query + description: Search pattern + required: true + schema: + type: "string" + examples: + any: + summary: Any value + value: "*" + prefix: + summary: Given prefix + value: "zone1-*" + anywhere: + summary: Substring + value: "something" + responses: + 200: + $ref: '#/components/responses/ManyMenuApp' + 400: + $ref: '#/components/responses/Error' + + /api/v1/menu/app/{cat}/{confKey}: + get: + tags: + - menuapp + summary: Get Menu Application within a Menu Category by configuration key + description: Returns a single application + operationId: getMenuAppByConfKey + parameters: + - name: cat + in: path + description: Configuration key of Menu Category to work with + required: true + schema: + $ref: '#/components/schemas/menuCatConfKey' + - name: confKey + in: path + description: Configuration key of Menu Application + required: true + schema: + $ref: '#/components/schemas/confKey' + responses: + 200: + $ref: '#/components/responses/OneMenuApp' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + + put: + tags: + - menuapp + summary: Replaces a Menu Application + operationId: replaceMenuApp + parameters: + - name: cat + in: path + description: Configuration key of Menu Category to work with + required: true + schema: + $ref: '#/components/schemas/menuCatConfKey' + - name: confKey + in: path + description: Configuration key of Menu Application that needs to be replaced + required: true + schema: + $ref: '#/components/schemas/confKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MenuApp' + responses: + 204: + $ref: '#/components/responses/NoContent' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' + patch: + tags: + - menuapp + summary: Updates a Menu Application + operationId: updateMenuApp + parameters: + - name: cat + in: path + description: Configuration key of Menu Category to work with + required: true + schema: + $ref: '#/components/schemas/menuCatConfKey' + - name: confKey + in: path + description: Configuration key of Menu Application that needs to be updated + required: true + schema: + $ref: '#/components/schemas/confKey' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MenuAppUpdate' + responses: + 204: + $ref: '#/components/responses/NoContent' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' + + delete: + tags: + - menuapp + summary: Deletes a Menu Application + operationId: deleteMenuApp + parameters: + - name: cat + in: path + description: Configuration key of Menu Category to work with + required: true + schema: + $ref: '#/components/schemas/menuCatConfKey' + - name: confKey + in: path + description: Configuration key of Menu Application to delete + required: true + schema: + $ref: '#/components/schemas/confKey' + responses: + 204: + $ref: '#/components/responses/NoContent' + 400: + $ref: '#/components/responses/Error' + 404: + $ref: '#/components/responses/NotFound' + components: schemas: confKey: @@ -925,6 +1276,90 @@ components: items: $ref: "#/components/schemas/SecondFactor" + menuCatConfKey: + type: string + pattern: '^\w[\w\.\-]*$' + MenuCat: + required: + - confKey + - catname + type: object + properties: + confKey: + $ref: '#/components/schemas/confKey' + catname: + type: string + order: + type: integer + MenuCatUpdate: + type: object + properties: + catname: + type: string + order: + type: integer + MenuApp: + required: + - confKey + type: object + properties: + confKey: + $ref: '#/components/schemas/confKey' + order: + type: integer + options: + $ref: '#/components/schemas/MenuAppOptions' + MenuAppOptions: + required: + - name + type: object + properties: + name: + type: string + tooltip: + type: string + description: + type: string + uri: + type: string + logo: + type: string + default: network.png + enum: + - attach.png + - bell.png + - bookmark.png + - configure.png + - database.png + - demo.png + - folder.png + - gear.png + - help.png + - llng.png + - mailappt.png + - money.png + - network.png + - terminal.png + - thumbnail.png + - tux.png + - web.png + - (Any reference to an available image in app logo folder) + display: + type: string + default: auto + enum: + - 'on' + - 'off' + - auto + - (Any special rule to apply for example "$uid eq 'dwho'") + MenuAppUpdate: + type: object + properties: + order: + type: integer + options: + $ref: '#/components/schemas/MenuAppOptions' + responses: NoContent: description: Successful modification @@ -1002,3 +1437,31 @@ components: application/json: schema: $ref: "#/components/schemas/SecondFactors" + OneMenuCat: + description: Return a Menu Category + content: + application/json: + schema: + $ref: '#/components/schemas/MenuCat' + ManyMenuCat: + description: Return a list of Menu Categories + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MenuCat' + OneMenuApp: + description: Return a Menu Application + content: + application/json: + schema: + $ref: '#/components/schemas/MenuApp' + ManyMenuApp: + description: Return a list of Menu Applications + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MenuApp' diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api.pm index d9b1ed86a..786dc98df 100644 --- a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api.pm +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api.pm @@ -13,8 +13,10 @@ use Lemonldap::NG::Manager::Api::2F; use Lemonldap::NG::Manager::Api::Providers::OidcRp; use Lemonldap::NG::Manager::Api::Providers::SamlSp; use Lemonldap::NG::Manager::Api::Providers::CasApp; +use Lemonldap::NG::Manager::Api::Menu::Cat; +use Lemonldap::NG::Manager::Api::Menu::App; -our $VERSION = '2.0.8'; +our $VERSION = '2.0.9'; ############################# # I. INITIALIZATION METHODS # @@ -77,6 +79,24 @@ sub init { '*' => 'getSecondFactors' }, }, + menu => { + cat => { + findByConfKey => { + ':uPattern' => 'findMenuCatByConfKey' + }, + ':confKey' => { + '*' => 'getMenuCatByConfKey' + } + }, + app => { + ':confKey' => { + findByConfKey => { + ':uPattern' => 'findMenuAppByConfKey' + }, + ':appConfKey' => 'getMenuApp' + } + }, + }, }, }, ['GET'] @@ -96,6 +116,12 @@ sub init { app => 'addCasApp' }, }, + menu => { + cat => 'addMenuCat', + app => { + ':confKey' => 'addMenuApp' + } + }, }, }, ['POST'] @@ -115,6 +141,14 @@ sub init { app => { ':confKey' => 'replaceCasApp' } }, }, + menu => { + cat => { ':confKey' => 'replaceMenuCat' }, + app => { + ':confKey' => { + ':appConfKey' => 'replaceMenuApp' + } + } + }, }, }, ['PUT'] @@ -134,6 +168,14 @@ sub init { app => { ':confKey' => 'updateCasApp' } }, }, + menu => { + cat => { ':confKey' => 'updateMenuCat' }, + app => { + ':confKey' => { + ':appConfKey' => 'updateMenuApp' + } + } + }, }, }, ['PATCH'] @@ -164,6 +206,14 @@ sub init { '*' => 'deleteSecondFactors' }, }, + menu => { + cat => { ':confKey' => 'deleteMenuCat' }, + app => { + ':confKey' => { + ':appConfKey' => 'deleteMenuApp' + } + } + }, }, }, ['DELETE'] diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Menu/App.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Menu/App.pm new file mode 100644 index 000000000..001aee5b5 --- /dev/null +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Menu/App.pm @@ -0,0 +1,408 @@ +package Lemonldap::NG::Manager::Api::Menu::App; + +our $VERSION = '2.0.9'; + +package Lemonldap::NG::Manager::Api; + +use 5.10.0; +use utf8; +use Mouse; +use Lemonldap::NG::Manager::Conf::Parser; +use Data::Dumper; + +extends 'Lemonldap::NG::Manager::Api::Common'; + +sub getMenuApp { + my ( $self, $req ) = @_; + + my $catConfKey = $req->params('confKey') + or return $self->sendError( $req, 'Category confKey is missing', 400 ); + + my $appConfKey = $req->params('appConfKey'); + + # Get latest configuration + my $conf = $self->_confAcc->getConf; + + # Check if catConfKey is defined + return $self->sendError( $req, + "Menu category '$catConfKey' not found", 404 ) + unless ( defined $conf->{applicationList}->{$catConfKey} ); + + if ( defined $appConfKey ) { + + # Return one application referenced with this appConfKey + $self->logger->debug( +"[API] Menu application $appConfKey from category $catConfKey configuration requested" + ); + + my $menuApp = + $self->_getMenuAppByConfKey( $conf, $catConfKey, $appConfKey ); + + # Return 404 if not found + return $self->sendError( + $req, +"Menu application '$appConfKey' from category '$catConfKey' not found", + 404 + ) unless ( defined $menuApp ); + + return $self->sendJSONresponse( $req, $menuApp ); + + } + else { + + # Return all applications for this category + $self->logger->debug( +"[API] Menu applications from category $catConfKey configuration requested" + ); + + my $cat = $conf->{applicationList}->{$catConfKey}; + + my @menuApps = + map { + $self->_isCatApp( $cat->{$_} ) + ? $self->_getMenuAppByConfKey( $conf, $catConfKey, $_ ) + : () + } + keys %{$cat}; + + return $self->sendJSONresponse( $req, [@menuApps] ); + + } +} + +sub findMenuAppByConfKey { + my ( $self, $req ) = @_; + + my $catConfKey = $req->params('confKey') + or return $self->sendError( $req, 'Category confKey is missing', 400 ); + + my $pattern = ( + defined $req->params('uPattern') + ? $req->params('uPattern') + : ( defined $req->params('pattern') ? $req->params('pattern') : undef ) + ); + + return $self->sendError( $req, 'Invalid input: pattern is missing', 400 ) + unless ( defined $pattern ); + + unless ( $pattern = $self->_getRegexpFromPattern($pattern) ) { + return $self->sendError( $req, 'Invalid input: pattern is invalid', + 400 ); + } + + $self->logger->debug( +"[API] Find Menu Applications from category $catConfKey by confKey regexp $pattern requested" + ); + + # Get latest configuration + my $conf = $self->_confAcc->getConf; + + # Check if catConfKey is defined + return $self->sendError( $req, + "Menu category '$catConfKey' not found", 404 ) + unless ( defined $conf->{applicationList}->{$catConfKey} ); + + my $cat = $conf->{applicationList}->{$catConfKey}; + + my @menuApps = + map { + $self->_isCatApp( $cat->{$_} ) + && $_ =~ $pattern + ? $self->_getMenuAppByConfKey( $conf, $catConfKey, $_ ) + : () + } + keys %{$cat}; + + return $self->sendJSONresponse( $req, [@menuApps] ); +} + +sub addMenuApp { + my ( $self, $req ) = @_; + my $add = $req->jsonBodyToObj; + + my $catConfKey = $req->params('confKey') + or return $self->sendError( $req, 'Category confKey is missing', 400 ); + + return $self->sendError( $req, "Invalid input: " . $req->error, 400 ) + unless ($add); + + return $self->sendError( $req, 'Invalid input: confKey is missing', 400 ) + unless ( defined $add->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey is not a string', + 400 ) + if ( ref $add->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey contains invalid characters', + 400 ) + unless ( $add->{confKey} =~ '^\w[\w\.\-]*$' ); + + return $self->sendError( $req, 'Invalid input: name is missing', 400 ) + unless ( defined $add->{options} && defined $add->{options}{name} ); + + return $self->sendError( $req, 'Invalid input: name is not a string', 400 ) + if ( ref $add->{options}{name} ); + + $self->logger->debug( +"[API] Add Menu Application from category $catConfKey with confKey $add->{confKey} requested" + ); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + # Check if catConfKey is defined + return $self->sendError( $req, + "Menu category '$catConfKey' not found", 404 ) + unless ( defined $conf->{applicationList}->{$catConfKey} ); + + return $self->sendError( + $req, +"Invalid input: A Menu Application with confKey $add->{confKey} already exists in category $catConfKey", + 409 + ) + if ( + defined $self->_getMenuAppByConfKey( $conf, $catConfKey, + $add->{confKey} ) ); + + my $res = + $self->_pushMenuApp( $conf, $catConfKey, $add->{confKey}, $add, 1 ); + + return $self->sendError( $req, $res->{msg}, 400 ) + unless ( $res->{res} eq 'ok' ); + + return $self->sendJSONresponse( + $req, + { message => "Successful operation" }, + code => 201 + ); +} + +sub updateMenuApp { + my ( $self, $req ) = @_; + + my $catConfKey = $req->params('confKey') + or return $self->sendError( $req, 'Category confKey is missing', 400 ); + + my $appConfKey = $req->params('appConfKey') + or return $self->sendError( $req, 'Application confKey is missing', 400 ); + + my $update = $req->jsonBodyToObj; + + return $self->sendError( $req, "Invalid input: " . $req->error, 400 ) + unless ($update); + + $self->logger->debug( +"[API] Menu application $appConfKey from category $catConfKey configuration update requested" + ); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + # Return 404 if not found + + return $self->sendError( $req, + "Menu category '$catConfKey' not found", 404 ) + unless ( defined $self->_getMenuCatByConfKey( $conf, $catConfKey ) ); + + return $self->sendError( + $req, + "Menu application '$appConfKey' from category '$catConfKey' not found", + 404 + ) + unless ( + defined $self->_getMenuAppByConfKey( $conf, $catConfKey, $appConfKey ) + ); + + my $res = + $self->_pushMenuApp( $conf, $catConfKey, $appConfKey, $update, 0 ); + + return $self->sendError( $req, $res->{msg}, 400 ) + unless ( $res->{res} eq 'ok' ); + + return $self->sendJSONresponse( $req, undef, code => 204 ); +} + +sub replaceMenuApp { + my ( $self, $req ) = @_; + my $catConfKey = $req->params('confKey') + or return $self->sendError( $req, 'Category confKey is missing', 400 ); + + my $appConfKey = $req->params('appConfKey') + or return $self->sendError( $req, 'Application confKey is missing', 400 ); + + my $replace = $req->jsonBodyToObj; + + return $self->sendError( $req, "Invalid input: " . $req->error, 400 ) + unless ($replace); + + return $self->sendError( $req, 'Invalid input: confKey is missing', 400 ) + unless ( defined $replace->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey is not a string', + 400 ) + if ( ref $replace->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey contains invalid characters', + 400 ) + unless ( $replace->{confKey} =~ '^\w[\w\.\-]*$' ); + + return $self->sendError( $req, 'Invalid input: name is missing', 400 ) + unless ( defined $replace->{options} + && defined $replace->{options}{name} ); + + return $self->sendError( $req, 'Invalid input: name is not a string', 400 ) + if ( ref $replace->{options}{name} ); + + $self->logger->debug( +"[API] Menu application $appConfKey from category $catConfKey configuration replace requested" + ); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + # Return 404 if not found + + return $self->sendError( $req, + "Menu category '$catConfKey' not found", 404 ) + unless ( defined $self->_getMenuCatByConfKey( $conf, $catConfKey ) ); + + return $self->sendError( + $req, + "Menu application '$appConfKey' from category '$catConfKey' not found", + 404 + ) + unless ( + defined $self->_getMenuAppByConfKey( $conf, $catConfKey, $appConfKey ) + ); + + my $res = + $self->_pushMenuApp( $conf, $catConfKey, $appConfKey, $replace, 1 ); + return $self->sendError( $req, $res->{msg}, 400 ) + unless ( $res->{res} eq 'ok' ); + + return $self->sendJSONresponse( $req, undef, code => 204 ); +} + +sub deleteMenuApp { + my ( $self, $req ) = @_; + + my $catConfKey = $req->params('confKey') + or return $self->sendError( $req, 'Category confKey is missing', 400 ); + + my $appConfKey = $req->params('appConfKey') + or return $self->sendError( $req, 'Application confKey is missing', 400 ); + + $self->logger->debug( +"[API] Menu Application $appConfKey from category $catConfKey configuration delete requested" + ); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + return $self->sendError( $req, + "Menu category '$catConfKey' not found", 404 ) + unless ( defined $self->_getMenuCatByConfKey( $conf, $catConfKey ) ); + + my $delete = $self->_getMenuAppByConfKey( $conf, $catConfKey, $appConfKey ); + + # Return 404 if not found + + return $self->sendError( $req, + "Menu category '$appConfKey' not found", 404 ) + unless ( defined $delete ); + + delete $conf->{applicationList}->{$catConfKey}->{$appConfKey}; + + # Save configuration + $self->_confAcc->saveConf($conf); + + return $self->sendJSONresponse( $req, undef, code => 204 ); +} + +sub _isCatApp { + my ( $self, $candidate ) = @_; + +# Check if candidate is a hash, has "type" defined and if "type" equals "application". + return + ref $candidate eq ref {} + && defined $candidate->{type} + && $candidate->{type} eq 'application'; +} + +sub _getMenuAppByConfKey { + my ( $self, $conf, $catConfKey, $appConfKey ) = @_; + + # Check if catConfKey is defined + return undef unless ( defined $conf->{applicationList}->{$catConfKey} ); + + # Check if appConfKey is defined + return undef + unless ( defined $conf->{applicationList}->{$catConfKey}->{$appConfKey} ); + + my $cat = $conf->{applicationList}->{$catConfKey}; + + my $menuApp = { confKey => $appConfKey }; + + $menuApp->{order} = $cat->{$appConfKey}->{order} + if ( defined $cat->{$appConfKey}->{order} ); + + # Get options + my $options = {}; + for my $configOption ( keys %{ $cat->{$appConfKey}->{options} } ) { + $options->{ $self->_translateOptionConfToApi($configOption) } = + $cat->{$appConfKey}->{options}->{$configOption}; + } + + $menuApp->{options} = $options; + + return $menuApp; +} + +sub _pushMenuApp { + my ( $self, $conf, $catConfKey, $appConfKey, $push, $replace ) = @_; + + if ($replace) { + $conf->{applicationList}->{$catConfKey}->{$appConfKey} = {}; + $conf->{applicationList}->{$catConfKey}->{$appConfKey}->{type} = + "application"; + $conf->{applicationList}->{$catConfKey}->{$appConfKey}->{options} = {}; + $conf->{applicationList}->{$catConfKey}->{$appConfKey}->{options} + ->{display} = "auto"; + $conf->{applicationList}->{$catConfKey}->{$appConfKey}->{options} + ->{logo} = "network.png"; + } + + $conf->{applicationList}->{$catConfKey}->{$appConfKey}->{order} = + $push->{order} + if ( defined $push->{order} ); + + if ( defined $push->{options} ) { + foreach ( keys %{ $push->{options} } ) { + $conf->{applicationList}->{$catConfKey}->{$appConfKey}->{options} + ->{$_} = $push->{options}->{$_}; + } + } + + # Test new configuration + my $parser = Lemonldap::NG::Manager::Conf::Parser->new( { + refConf => $self->_confAcc->getConf, + newConf => $conf, + req => {}, + } + ); + unless ( $parser->testNewConf( $self->p ) ) { + return { + res => 'ko', + code => 400, + msg => "Configuration error: " + . join( ". ", map { $_->{message} } @{ $parser->errors } ), + }; + } + + # Save configuration + $self->_confAcc->saveConf($conf); + + return { res => 'ok' }; +} + +1; diff --git a/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Menu/Cat.pm b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Menu/Cat.pm new file mode 100644 index 000000000..33d397cb6 --- /dev/null +++ b/lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Menu/Cat.pm @@ -0,0 +1,270 @@ +package Lemonldap::NG::Manager::Api::Menu::Cat; + +our $VERSION = '2.0.9'; + +package Lemonldap::NG::Manager::Api; + +use 5.10.0; +use utf8; +use Mouse; +use Lemonldap::NG::Manager::Conf::Parser; + +extends 'Lemonldap::NG::Manager::Api::Common'; + +sub getMenuCatByConfKey { + my ( $self, $req ) = @_; + + my $confKey = $req->params('confKey') + or return $self->sendError( $req, 'confKey is missing', 400 ); + + $self->logger->debug( + "[API] Menu Category $confKey configuration requested"); + + # Get latest configuration + my $conf = $self->_confAcc->getConf; + + my $menuCat = $self->_getMenuCatByConfKey( $conf, $confKey ); + + # Return 404 if not found + return $self->sendError( $req, "Menu category '$confKey' not found", 404 ) + unless ( defined $menuCat ); + + return $self->sendJSONresponse( $req, $menuCat ); +} + +sub findMenuCatByConfKey { + my ( $self, $req ) = @_; + + my $pattern = ( + defined $req->params('uPattern') + ? $req->params('uPattern') + : ( defined $req->params('pattern') ? $req->params('pattern') : undef ) + ); + + return $self->sendError( $req, 'Invalid input: pattern is missing', 400 ) + unless ( defined $pattern ); + + unless ( $pattern = $self->_getRegexpFromPattern($pattern) ) { + return $self->sendError( $req, 'Invalid input: pattern is invalid', + 400 ); + } + + $self->logger->debug( + "[API] Find Menu Categories by confKey regexp $pattern requested"); + + # Get latest configuration + my $conf = $self->_confAcc->getConf; + + my @menuCats = + map { $_ =~ $pattern ? $self->_getMenuCatByConfKey( $conf, $_ ) : () } + keys %{ $conf->{applicationList} }; + + return $self->sendJSONresponse( $req, [@menuCats] ); +} + +sub addMenuCat { + my ( $self, $req ) = @_; + my $add = $req->jsonBodyToObj; + + return $self->sendError( $req, "Invalid input: " . $req->error, 400 ) + unless ($add); + + return $self->sendError( $req, 'Invalid input: confKey is missing', 400 ) + unless ( defined $add->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey is not a string', + 400 ) + if ( ref $add->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey contains invalid characters', + 400 ) + unless ( $add->{confKey} =~ '^\w[\w\.\-]*$' ); + + return $self->sendError( $req, 'Invalid input: catname is missing', 400 ) + unless ( defined $add->{catname} ); + + return $self->sendError( $req, 'Invalid input: catname is not a string', + 400 ) + if ( ref $add->{catname} ); + + $self->logger->debug( + "[API] Add Menu Category with confKey $add->{confKey} requested"); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + return $self->sendError( + $req, +"Invalid input: A Menu Category with confKey $add->{confKey} already exists", + 409 + ) if ( defined $self->_getMenuCatByConfKey( $conf, $add->{confKey} ) ); + + my $res = $self->_pushMenuCat( $conf, $add->{confKey}, $add, 1 ); + + return $self->sendError( $req, $res->{msg}, 400 ) + unless ( $res->{res} eq 'ok' ); + + return $self->sendJSONresponse( + $req, + { message => "Successful operation" }, + code => 201 + ); +} + +sub updateMenuCat { + my ( $self, $req ) = @_; + my $confKey = $req->params('confKey') + or return $self->sendError( $req, 'confKey is missing', 400 ); + + my $update = $req->jsonBodyToObj; + + return $self->sendError( $req, "Invalid input: " . $req->error, 400 ) + unless ($update); + + $self->logger->debug( + "[API] Menu Category $confKey configuration update requested"); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + my $current = $self->_getMenuCatByConfKey( $conf, $confKey ); + + # Return 404 if not found + + return $self->sendError( $req, "Menu category '$confKey' not found", 404 ) + unless ( defined $current ); + + my $res = $self->_pushMenuCat( $conf, $confKey, $update, 0 ); + + return $self->sendError( $req, $res->{msg}, 400 ) + unless ( $res->{res} eq 'ok' ); + + return $self->sendJSONresponse( $req, undef, code => 204 ); +} + +sub replaceMenuCat { + my ( $self, $req ) = @_; + my $confKey = $req->params('confKey') + or return $self->sendError( $req, 'confKey is missing', 400 ); + + my $replace = $req->jsonBodyToObj; + + return $self->sendError( $req, "Invalid input: " . $req->error, 400 ) + unless ($replace); + + return $self->sendError( $req, 'Invalid input: confKey is missing', 400 ) + unless ( defined $replace->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey is not a string', + 400 ) + if ( ref $replace->{confKey} ); + + return $self->sendError( $req, 'Invalid input: confKey contains invalid characters', + 400 ) + unless ( $replace->{confKey} =~ '^\w[\w\.\-]*$' ); + + return $self->sendError( $req, 'Invalid input: catname is missing', 400 ) + unless ( defined $replace->{catname} ); + + return $self->sendError( $req, 'Invalid input: catname is not a string', + 400 ) + if ( ref $replace->{catname} ); + + $self->logger->debug( + "[API] Menu Category $confKey configuration replace requested"); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + # Return 404 if not found + + return $self->sendError( $req, "Menu category '$confKey' not found", 404 ) + unless ( defined $self->_getMenuCatByConfKey( $conf, $confKey ) ); + + my $res = $self->_pushMenuCat( $conf, $confKey, $replace, 1 ); + return $self->sendError( $req, $res->{msg}, 400 ) + unless ( $res->{res} eq 'ok' ); + + return $self->sendJSONresponse( $req, undef, code => 204 ); +} + +sub deleteMenuCat { + my ( $self, $req ) = @_; + my $confKey = $req->params('confKey') + or return $self->sendError( $req, 'confKey is missing', 400 ); + + $self->logger->debug( + "[API] Menu Category $confKey configuration delete requested"); + + # Get latest configuration + my $conf = $self->_confAcc->getConf( { noCache => 1 } ); + + my $delete = $self->_getMenuCatByConfKey( $conf, $confKey ); + + # Return 404 if not found + + return $self->sendError( $req, "Menu category '$confKey' not found", 404 ) + unless ( defined $delete ); + + delete $conf->{applicationList}->{$confKey}; + + # Save configuration + $self->_confAcc->saveConf($conf); + + return $self->sendJSONresponse( $req, undef, code => 204 ); +} + +sub _getMenuCatByConfKey { + my ( $self, $conf, $confKey ) = @_; + + # Check if confKey is defined + return undef unless ( defined $conf->{applicationList}->{$confKey} ); + + my $menuCat = { + confKey => $confKey, + catname => $conf->{applicationList}->{$confKey}->{catname} + }; + + $menuCat->{order} = $conf->{applicationList}->{$confKey}->{order} + if ( defined $conf->{applicationList}->{$confKey}->{order} ); + + return $menuCat; +} + +sub _pushMenuCat { + my ( $self, $conf, $confKey, $push, $replace ) = @_; + + if ($replace) { + $conf->{applicationList}->{$confKey} = {}; + $conf->{applicationList}->{$confKey}->{type} = "category"; + } + + $conf->{applicationList}->{$confKey}->{order} = $push->{order} + if ( defined $push->{order} ); + + $conf->{applicationList}->{$confKey}->{catname} = $push->{catname} + if ( defined $push->{catname} ); + + # Test new configuration + my $parser = Lemonldap::NG::Manager::Conf::Parser->new( { + refConf => $self->_confAcc->getConf, + newConf => $conf, + req => {}, + } + ); + unless ( $parser->testNewConf( $self->p ) ) { + return { + res => 'ko', + code => 400, + msg => "Configuration error: " + . join( ". ", map { $_->{message} } @{ $parser->errors } ), + }; + } + + # Save configuration + $self->_confAcc->saveConf($conf); + + return { res => 'ok' }; +} + +1; diff --git a/lemonldap-ng-manager/t/04-menu-api.t b/lemonldap-ng-manager/t/04-menu-api.t new file mode 100644 index 000000000..6b45423a0 --- /dev/null +++ b/lemonldap-ng-manager/t/04-menu-api.t @@ -0,0 +1,515 @@ +# Test Providers API + +use Test::More; +use strict; +use JSON; +use IO::String; +require 't/test-lib.pm'; + +our $_json = JSON->new->allow_nonref; + +sub check201 { + my ( $test, $res ) = splice @_; + + #diag Dumper($res); + is( $res->[0], "201", "$test: Result code is 201" ) + or diag explain $res->[2]; + count(1); + checkJson( $test, $res ); +} + +sub check204 { + my ( $test, $res ) = splice @_; + + #diag Dumper($res); + is( $res->[0], "204", "$test: Result code is 204" ) + or diag explain $res->[2]; + count(1); + is( $res->[2]->[0], undef, "204 code returns no content" ); +} + +sub check200 { + my ( $test, $res ) = splice @_; + + #diag Dumper($res); + is( $res->[0], "200", "$test: Result code is 200" ) + or diag explain $res->[2]; + count(1); + checkJson( $test, $res ); + +} + +sub check409 { + my ( $test, $res ) = splice @_; + + #diag Dumper($res); + is( $res->[0], "409", "$test: Result code is 409" ) + or diag explain $res->[2]; + count(1); + checkJson( $test, $res ); +} + +sub check404 { + my ( $test, $res ) = splice @_; + + #diag Dumper($res); + is( $res->[0], "404", "$test: Result code is 404" ) + or diag explain $res->[2]; + count(1); + checkJson( $test, $res ); +} + +sub check400 { + my ( $test, $res ) = splice @_; + is( $res->[0], "400", "$test: Result code is 400" ) + or diag explain $res->[2]; + count(1); + count(1); + checkJson( $test, $res ); +} + +sub checkJson { + my ( $test, $res ) = splice @_; + my $key; + + #diag Dumper($res->[2]->[0]); + ok( $key = from_json( $res->[2]->[0] ), "$test: Response is JSON" ); + count(1); +} + +sub add { + my ( $test, $type, $obj ) = splice @_; + my $j = $_json->encode($obj); + my $res; + + #diag Dumper($j); + ok( + $res = &client->_post( + "/api/v1/menu/$type", '', + IO::String->new($j), 'application/json', + length($j) + ), + "$test: Request succeed" + ); + count(1); + return $res; +} + +sub checkAdd { + my ( $test, $type, $add ) = splice @_; + check201( $test, add( $test, $type, $add ) ); +} + +sub checkAddNotFound { + my ( $test, $type, $add ) = splice @_; + check404( $test, add( $test, $type, $add ) ); +} + +sub checkAddFailsIfExists { + my ( $test, $type, $add ) = splice @_; + check409( $test, add( $test, $type, $add ) ); +} + +sub checkAddFailsOnInvalidConfkey { + my ( $test, $type, $add ) = splice @_; + check400( $test, add( $test, $type, $add ) ); +} + +sub get { + my ( $test, $type, $confKey ) = splice @_; + my $res; + ok( $res = &client->_get( "/api/v1/menu/$type/$confKey", '' ), + "$test: Request succeed" ); + count(1); + return $res; +} + +sub checkGet { + my ( $test, $type, $confKey, $attrPath, $expectedValue ) = splice @_; + my $res = get( $test, $type, $confKey ); + check200( $test, $res ); + my @path = split '/', $attrPath; + my $key = from_json( $res->[2]->[0] ); + for (@path) { + if ( ref($key) eq 'ARRAY' ) { + $key = $key->[$_]; + } + else { + $key = $key->{$_}; + } + } + ok( + $key eq $expectedValue, +"$test: check if $attrPath value \"$key\" matches expected value \"$expectedValue\"" + ); + count(1); +} + +sub checkGetNotFound { + my ( $test, $type, $confKey ) = splice @_; + check404( $test, get( $test, $type, $confKey ) ); +} + +sub checkGetList { + my ( $test, $type, $confKey, $expectedHits ) = splice @_; + my $res = get( $test, $type, $confKey ); + check200( $test, $res ); + my $hits = from_json( $res->[2]->[0] ); + my $counter = @{$hits}; + ok( + $counter eq $expectedHits, +"$test: check if nb of hits returned ($counter) matches expectation ($expectedHits)" + ); + count(1); +} + +sub update { + my ( $test, $type, $confKey, $obj ) = splice @_; + my $j = $_json->encode($obj); + + #diag Dumper($j); + my $res; + ok( + $res = &client->_patch( + "/api/v1/menu/$type/$confKey", '', + IO::String->new($j), 'application/json', + length($j) + ), + "$test: Request succeed" + ); + count(1); + return $res; +} + +sub checkUpdate { + my ( $test, $type, $confKey, $update ) = splice @_; + check204( $test, update( $test, $type, $confKey, $update ) ); +} + +sub checkUpdateNotFound { + my ( $test, $type, $confKey, $update ) = splice @_; + check404( $test, update( $test, $type, $confKey, $update ) ); +} + +sub checkUpdateFailsIfExists { + my ( $test, $type, $confKey, $update ) = splice @_; + check409( $test, update( $test, $type, $confKey, $update ) ); +} + +sub checkUpdateWithUnknownAttributes { + my ( $test, $type, $confKey, $update ) = splice @_; + check400( $test, update( $test, $type, $confKey, $update ) ); +} + +sub replace { + my ( $test, $type, $confKey, $obj ) = splice @_; + my $j = $_json->encode($obj); + my $res; + ok( + $res = &client->_put( + "/api/v1/menu/$type/$confKey", '', + IO::String->new($j), 'application/json', + length($j) + ), + "$test: Request succeed" + ); + count(1); + return $res; +} + +sub checkReplace { + my ( $test, $type, $confKey, $replace ) = splice @_; + check204( $test, replace( $test, $type, $confKey, $replace ) ); +} + +sub checkReplaceAlreadyThere { + my ( $test, $type, $confKey, $replace ) = splice @_; + check400( $test, replace( $test, $type, $confKey, $replace ) ); +} + +sub checkReplaceNotFound { + my ( $test, $type, $confKey, $update ) = splice @_; + check404( $test, replace( $test, $type, $confKey, $update ) ); +} + +sub checkReplaceWithInvalidAttribute { + my ( $test, $type, $confKey, $replace ) = splice @_; + check400( $test, replace( $test, $type, $confKey, $replace ) ); +} + +sub findByConfKey { + my ( $test, $type, $confKey ) = splice @_; + my $res; + ok( + $res = &client->_get( + "/api/v1/menu/$type/findByConfKey", + "pattern=$confKey" + ), + "$test: Request succeed" + ); + count(1); + return $res; +} + +sub checkFindByConfKeyError { + my ( $test, $type, $pattern ) = splice @_; + my $res = findByConfKey( $test, $type, $pattern ); + check400( $test, $res ); +} + +sub checkFindByConfKey { + my ( $test, $type, $confKey, $expectedHits ) = splice @_; + my $res = findByConfKey( $test, $type, $confKey ); + check200( $test, $res ); + my $hits = from_json( $res->[2]->[0] ); + my $counter = @{$hits}; + ok( + $counter eq $expectedHits, +"$test: check if nb of hits returned ($counter) matches expectation ($expectedHits)" + ); + count(1); +} + +sub deleteMenu { + my ( $test, $type, $confKey ) = splice @_; + my $res; + ok( + $res = &client->_del( + "/api/v1/menu/$type/$confKey", '', '', 'application/json', 0 + ), + "$test: Request succeed" + ); + count(1); + return $res; +} + +sub checkDelete { + my ( $test, $type, $confKey ) = splice @_; + check204( $test, deleteMenu( $test, $type, $confKey ) ); +} + +sub checkDeleteNotFound { + my ( $test, $type, $confKey ) = splice @_; + check404( $test, deleteMenu( $test, $type, $confKey ) ); +} + +my $test; + +my $cat1 = { + confKey => 'mycat1', + catname => 'My Cat 1', + order => 1 +}; +my $cat2 = { + confKey => 'mycat2', + catname => 'My Cat 2', + order => 2 +}; +my $cat3 = { + confKey => 'mycat/mycat3', + catname => 'My Cat 3', + order => 2 +}; +$test = "Cat - Get mycat1 cat should err on not found"; +checkGetNotFound( $test, 'cat', 'mycat1' ); + +$test = "Cat - Add should succeed"; +checkAdd( $test, 'cat', $cat1 ); +checkGet( $test, 'cat', 'mycat1', 'catname', 'My Cat 1' ); +checkGet( $test, 'cat', 'mycat1', 'order', 1 ); + +$test = "Cat - Add should fail on duplicate confKey"; +checkAddFailsIfExists( $test, 'cat', $cat1 ); + +$test = "Cat - Add should fail on invalid confKey"; +checkAddFailsOnInvalidConfkey( $test, 'cat', $cat3 ); + +checkAddFailsOnInvalidConfkey + +$test = "Cat - Update should succeed and keep existing values"; +$cat1->{order} = 3; +delete $cat1->{catname}; +checkUpdate( $test, 'cat', 'mycat1', $cat1 ); +checkGet( $test, 'cat', 'mycat1', 'catname', 'My Cat 1' ); +checkGet( $test, 'cat', 'mycat1', 'order', 3 ); + +$test = "Cat - Update should fail if confKey not found"; +$cat1->{confKey} = 'mycat3'; +checkUpdateNotFound( $test, 'cat', 'mycat3', $cat1 ); + +$test = "Cat - 2nd add should succeed"; +checkAdd( $test, 'cat', $cat2 ); + +$test = "Cat - Replace should succeed"; +delete $cat2->{order}; +checkReplace( $test, 'cat', 'mycat2', $cat2 ); + +$test = "Cat - Replace should fail if confKey not found"; +$cat2->{confKey} = 'mycat3'; +checkReplaceNotFound( $test, 'cat', 'mycat3', $cat2 ); + +$test = "Cat - FindByConfKey should find 2 hits"; +checkFindByConfKey( $test, 'cat', 'mycat', 2 ); + +$test = "Cat - FindByConfKey should find 1 hits"; +checkFindByConfKey( $test, 'cat', 'mycat1', 1 ); + +$test = "Cat - FindByConfKey should find 1 hits"; +checkFindByConfKey( $test, 'cat', 'mycat2', 1 ); + +$test = "Cat - FindByConfKey should find 0 hits"; +checkFindByConfKey( $test, 'cat', 'mycat3', 0 ); + +$test = "Cat - FindByConfKey should err on invalid patterns"; +checkFindByConfKeyError( $test, 'cat', '' ); +checkFindByConfKeyError( $test, 'cat', '$' ); + +my $app1 = { + confKey => 'myapp1', + options => { + name => 'My App 1', + description => 'My app 1 description', + tooltip => 'My app 1 tooltip', + uri => 'http://app1.example.com/' + }, + order => 1 +}; +my $app2 = { + confKey => 'myapp2', + options => { + name => 'My App 2', + description => 'My app 2 description', + display => 'enabled', + logo => 'demo.png', + tooltip => 'My app 2 tooltip', + uri => 'http://app2.example.com/' + }, + order => 2 +}; +my $app3 = { + confKey => 'myapp3', + options => { + name => 'My App 3', + description => 'My app 3 description', + display => "\$uid eq 'dwho'", + logo => 'attach.png', + tooltip => 'My app 3 tooltip', + uri => 'http://app3.example.com/' + }, + order => 1 +}; +my $app4 = { + confKey => 'myapp1/myapp4', + options => { + name => 'My App 4', + description => 'My app 4 description', + tooltip => 'My app 4 tooltip', + uri => 'http://app4.example.com/' + }, + order => 1 +}; + +$test = "App - Get mycat3 apps should err on not found"; +checkGetNotFound( $test, 'app', 'mycat3' ); + +$test = "App - Get app myapp1 from existing mycat2 should err on not found"; +checkGetNotFound( $test, 'app/mycat2', 'myapp1' ); + +$test = "App - Get app myapp1 from mycat3 should err on not found"; +checkGetNotFound( $test, 'app/mycat3', 'myapp1' ); + +$test = "App - Add app myapp1 to mycat3 should err on not found"; +checkAddNotFound( $test, 'app/mycat3', $app1); + +$test = "App - Add app1 to cat1 should succeed"; +checkAdd( $test, 'app/mycat1', $app1 ); +checkGet( $test, 'app/mycat1', 'myapp1', 'order', '1' ); +checkGet( $test, 'app/mycat1', 'myapp1', 'options/name', 'My App 1' ); +checkGet( $test, 'app/mycat1', 'myapp1', 'options/description', + 'My app 1 description' ); +checkGet( $test, 'app/mycat1', 'myapp1', 'options/tooltip', + 'My app 1 tooltip' ); +checkGet( $test, 'app/mycat1', 'myapp1', 'options/uri', + 'http://app1.example.com/' ); + +$test = "App - Add app2 to cat1 should succeed"; +checkAdd( $test, 'app/mycat1', $app2 ); +checkGet( $test, 'app/mycat1', 'myapp2', 'order', '2' ); +checkGet( $test, 'app/mycat1', 'myapp2', 'options/name', 'My App 2' ); +checkGet( $test, 'app/mycat1', 'myapp2', 'options/logo', 'demo.png' ); + +$test = "App - Add app3 to cat2 should succeed"; +checkAdd( $test, 'app/mycat2', $app3 ); +checkGet( $test, 'app/mycat2', 'myapp3', 'order', '1' ); +checkGet( $test, 'app/mycat2', 'myapp3', 'options/display', "\$uid eq 'dwho'" ); + +$test = "App - Add should fail on duplicate confKey"; +checkAddFailsIfExists( $test, 'app/mycat1', $app1 ); + +$test = "App - Add should fail on invalid confKey"; +checkAddFailsOnInvalidConfkey( $test, 'app/mycat1', $app4 ); + +$test = "App - Check default value were set"; +checkGet( $test, 'app/mycat1', 'myapp1', 'options/logo', 'network.png' ); +checkGet( $test, 'app/mycat1', 'myapp1', 'options/display', 'auto' ); + +$test = "App - Category 1 should return 2 apps"; +checkGetList( $test, 'app', 'mycat1', 2 ); + +$test = "App - Category 2 should return 1 app"; +checkGetList( $test, 'app', 'mycat2', 1 ); + +$test = "App - FindByConfKey should find 2 hits"; +checkFindByConfKey( $test, 'app/mycat1', '*', 2 ); + +$test = "App - FindByConfKey should find 1 hit"; +checkFindByConfKey( $test, 'app/mycat1', 'app1', 1 ); + +$test = "App - FindByConfKey should err on invalid patterns"; +checkFindByConfKeyError( $test, 'app/mycat1', '' ); +checkFindByConfKeyError( $test, 'app/mycat1', '$' ); + +$test = "App - Update should succeed and keep existing values"; +$app1->{options}->{name} = 'My App 1 updated'; +delete $app1->{options}->{tooltip}; +delete $app1->{order}; +checkUpdate( $test, 'app/mycat1', 'myapp1', $app1 ); +checkGet( $test, 'app/mycat1', 'myapp1', 'options/name', 'My App 1 updated' ); +checkGet( $test, 'app/mycat1', 'myapp1', 'options/tooltip', + 'My app 1 tooltip' ); +checkGet( $test, 'app/mycat1', 'myapp1', 'order', 1 ); + +$test = "App - Update should fail if confKey not found"; +checkUpdateNotFound( $test, 'app/mycat4', 'myapp1', $app1 ); +$app1->{confKey} = 'myapp4'; +checkUpdateNotFound( $test, 'app/mycat1', 'myapp4', $app1 ); + +$test = "App - Replace should succeed"; +$app3->{options}->{name} = 'My App 3 updated'; +checkReplace( $test, 'app/mycat2', 'myapp3', $app3 ); +checkGet( $test, 'app/mycat2', 'myapp3', 'options/name', 'My App 3 updated' ); + +$test = "App - Replace should fail if confKey not found"; +checkReplaceNotFound( $test, 'app/mycat4', 'myapp3', $app3 ); +$app3->{confKey} = 'myapp4'; +checkReplaceNotFound( $test, 'app/mycat2', 'myapp4', $app3 ); + +$test = "App - Delete should succeed"; +checkDelete( $test, 'app/mycat1', 'myapp2' ); + +$test = "App - Entity should not be found after deletion"; +checkDeleteNotFound( $test, 'app/mycat1', 'myapp2' ); + +$test = "App - Category 1 should return 1 app"; +checkGetList( $test, 'app', 'mycat1', 1 ); + +$test = "Cat - Clean up"; +checkDelete( $test, 'cat', 'mycat1' ); +checkDelete( $test, 'cat', 'mycat2' ); +$test = "cat - Entity should not be found after clean up"; +checkDeleteNotFound( $test, 'cat', 'mycat1' ); + +# Clean up generated conf files, except for "lmConf-1.json" +unlink grep { $_ ne "t/conf/lmConf-1.json" } glob "t/conf/lmConf-*.json"; + +done_testing();