Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login
    1. Home
    2. ahrensde
    A
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 8
    • Groups 0

    ahrensde

    @ahrensde

    1
    Reputation
    270
    Profile views
    8
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    ahrensde Unfollow Follow

    Best posts made by ahrensde

    • RE: Get all object data via API

      Thank you for the reply! This sounds much better 🙂

      While I wanted to ask again about this batch requests, I did some additionaly research...

      The only mentioning of batch request that I found in the i-doit documentation is in the "Tips and Tricks" section - the API documentation (1, 2, 3, 4) does not contain a single word.

      There is the JSON RPC 2.0 documentation, which specifies it - but the outdated PDF documentation tells me that batch is not supported.

      EDIT: ok, outdated docs tell that batch requests are supported since 1.4...

      Would be cool to get more information on that topic directly in the docs - because if you really want to do something useful with your API IMO this information is absolutely required. Otherwise you'll waste a lot of time with HTTP requests. And JSON RPC 2.0 is not that well known, that you can assume everybody knows that before. It is neither SOAP nor REST 😉

      Nevertheless - thanks for pointing me in the proper direction! I'll try this now.

      posted in Development
      A
      ahrensde

    Latest posts made by ahrensde

    • RE: Internal Server Error - Update von Kategorie

      Vielen Dank - sehr hilfreich!

      posted in Entwicklung
      A
      ahrensde
    • RE: Internal Server Error - Update von Kategorie

      Okay, die Antwort auf die erste Frage habe ich selbst gefunden. Mein API code scheint älter zu sein als der des aktuellen Plugins, v1.10. Daraus ergibt sich folgende weitere Frage:

      Was ist hier der empfohlene Weg bei Updates?

      Aktuell macht das ein Kollege mittels eures grafischen PHP clicky Updaters.

      LG

      posted in Entwicklung
      A
      ahrensde
    • RE: Internal Server Error - Update von Kategorie

      Ja, also das hat geholfen, Danke!

      Bleiben nur noch die Fragen offen:

      • Warum sah mein Code anders aus, als der von Ihnen?
      • Wie stelle ich sicher, dass das nicht durch ein Update überschrieben wird?

      LG

      posted in Entwicklung
      A
      ahrensde
    • RE: Internal Server Error - Update von Kategorie

      Bei mir sieht die veränderte Zeile aktuell so aus:

      global $g_absdir, $g_db_system, $g_config, $g_product_info, $g_crypto_hash;
      

      Soll ich da trotzdem "einfach" mal $g_convert ergänzen?

      LG

      posted in Entwicklung
      A
      ahrensde
    • RE: Internal Server Error - Update von Kategorie

      Ich habe jetzt erstmal nur den Part für C__CATG__MEMORY auskommentiert und der Datenabgleich funktioniert dann. D.h. grundsätzlich kann ich auch schreiben - nur halt nicht die genannte Kategorie. LG

      posted in Entwicklung
      A
      ahrensde
    • Internal Server Error - Update von Kategorie

      Hallo!

      mir stirbt die idoit API aktuell immer wieder bei dem Update einer Kategorie auf einem einzelnen Objekt ab.

      Kurzer Hintergrund: Ich bin nach einigen Monaten wieder zurück zur Schnittstellen Programmierung gegen die idoit API gekommen. Vorher lief das Ganze so recht und schlecht - seitdem haben Kollegen unser idoit auf 1.12.21 gezogen (von 1.11.x).

      Folgender request body löst den 500er aus:

      [
        {
          "method":"cmdb.category.update",
          "jsonrpc":"2.0",
          "params":{
            "category":"C__CATG__MEMORY",
            "data":{
              "category_id":2453,
              "unit":2,
              "capacity":4096.0,
              "title":7
            },
            "apikey":"********",
            "objID":45253
          },
          "id":0
        }
      ]
      

      im Apache2 Error Log steht dann folgendes:

      PHP Fatal error:  Uncaught Error: Call to a member function memory() on null in /var/www/html/idoit/src/classes/modules/logbook/isys_module_logbook.class.php:566
      Stack trace:
      #0 /var/www/html/idoit/src/classes/modules/api/model/cmdb/isys_api_model_cmdb_category.class.php(1072): isys_module_logbook->prepare_changes(Object(isys_cmdb_dao_category_g_memory), Array, Array)
      #1 /var/www/html/idoit/src/classes/modules/api/model/cmdb/isys_api_model_cmdb_category.class.php(1377): isys_api_model_cmdb_category->sync_wrapper(Array, 2)
      #2 /var/www/html/idoit/src/classes/modules/api/model/isys_api_model_cmdb.class.php(258): isys_api_model_cmdb_category->update(Array)
      #3 [internal function]: isys_api_model_cmdb->route('category', Array)
      #4 /var/www/html/idoit/src/classes/modules/api/src/Controller/JsonRpcController.php(84): call_user_func_array(Array, Array)
      #5 /var/www/html/idoit/src/classes/modules/api/src/Controller/JsonRpcController.php(194): idoit\\Module\\Api\\Controller\\JsonRpcController::runModel(Object(isys_api_model_cmdb), Array)
      #6 /v in /var/www/html/idoit/src/classes/modules/logbook/isys_module_logbook.class.php on line 566
      

      Lesender Zugriff auf die API ist kein Problem.

      Fehlt da ggf. nach dem Update noch ein Schritt, oder ist das einfach was kaputt? Hilfe! 🙂

      LG Dennis Ahrens

      posted in Entwicklung
      A
      ahrensde
    • RE: Get all object data via API

      Thank you for the reply! This sounds much better 🙂

      While I wanted to ask again about this batch requests, I did some additionaly research...

      The only mentioning of batch request that I found in the i-doit documentation is in the "Tips and Tricks" section - the API documentation (1, 2, 3, 4) does not contain a single word.

      There is the JSON RPC 2.0 documentation, which specifies it - but the outdated PDF documentation tells me that batch is not supported.

      EDIT: ok, outdated docs tell that batch requests are supported since 1.4...

      Would be cool to get more information on that topic directly in the docs - because if you really want to do something useful with your API IMO this information is absolutely required. Otherwise you'll waste a lot of time with HTTP requests. And JSON RPC 2.0 is not that well known, that you can assume everybody knows that before. It is neither SOAP nor REST 😉

      Nevertheless - thanks for pointing me in the proper direction! I'll try this now.

      posted in Development
      A
      ahrensde
    • RE: Get all object data via API

      I already figured out step one and two. But I stumble upon the third one.

      Is there a way to receive all category related data for an object in one API request? Currently I need to do ~30 requests per object (because there are that many categories attached to it) which performs quite poor when fetching 400 records.

      12000 HTTP requests for reading the data related to 400 objects is a lot IMO. Is there something I am missing or is this currently not supported? (i-doit 1.11)

      posted in Development
      A
      ahrensde