Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login
    1. Home
    2. fa__
    3. Posts
    F
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 13
    • Posts 23
    • Groups 0

    Posts

    Recent Best Controversial
    • Update API add-on in old i-doit open version

      I am using i-doit OPEN version 1.18.2 with API add-on version 1.12.3.
      I would like to update the API add-on to version 1.14.1 to solve an specific bug that is giving us trouble.

      Is it possible?
      I have been unable to find the add-on available for download.
      I have read in https://i-doit.org/ that the API is no longer available for i-doit open since version 29.
      However, I would like to maintain my current i-doit version.

      posted in Operating
      F
      fa__
    • Modification of Logbook

      Hello,

      I have discovered I can enter logbook entries manually or using the API. However, I have not found any way to modify manually/API created logbook entries.

      Is it possible?

      posted in General
      F
      fa__
    • RE: API, get person with person groups

      Hello @Eduardo-Casarero,

      You should try using the method cmdb.category.read for category "C__CATS__PERSON_ASSIGNED_GROUPS" using the user id.

      {
          "version": "2.0",
          "method": "cmdb.category.read",
          "params": {
              "objID": 158,
              "category": "C__CATS__PERSON_ASSIGNED_GROUPS",
              "apikey": "XXX"
          },
          "id": 1
      }
      
      posted in General
      F
      fa__
    • IP address validation in API

      Hello,

      I have noticed that IPv4 address is not validated through the API in the same way it is validated in the web.

      When created in the web, it is not acceptable to include an address that is not the IP range of the net or that already exits. However, there are no issues in doing so using the API.

      I have been able to reproduce this both on i-doit demo and on my i-doit 1.18.2 OPEN installation.

      Is there a way to enforce IPv4 address validation through the API?

      posted in General
      F
      fa__
    • RE: Validation error appears in API 1.12.3

      Thank @Michael-Overkamp!

      I confirm that the hotfix solves the issue.

      posted in Development
      F
      fa__
    • Validation error appears in API 1.12.3

      I am currently using i-doit 1.18.2 OPEN and API 1.12.3.
      In this setup, there are some API calls that fail and that used to work in my previous i-doit version. They are still working in the i-doit demo.

      The API response includes the error: "The provided property is virtual and can not be updated via API. Please provide a valid definition."
      I have not been able to find anything in the changelog that suggests why this may happen. I have not found any reference to virtual properties in the Knowledge Base either.

      The API call that fails are the following.

      • Creating 'C__CATS__FILE_VERSIONS' including 'file_content' property
      {
          "version": "2.0",
          "method": "cmdb.category.save",
          "params": {
              "object": 3628,
              "category": "C__CATS__FILE_VERSIONS",
              "apikey": "XXXXX",
              "language": "en",
              "data": {
                      "file_title": "file.txt",
                      "file_physical": "file.txt",
                      "file_content":"VGhpcyBpcyBhIHRlc3QgZmlsZS4NClRoaXMgaXMgYSB0ZXN0IGZpbGUuDQpUaGlzIGlzIGEgdGVzdCBmaWxlLg0KVGhpcyBpcyBhIHRlc3QgZmlsZS4NClRoaXMgaXMgYSB0ZXN0IGZpbGUuDQpUaGlzIGlzIGEgdGVzdCBmaWxlLg=="
                  }
          },
          "id": 1
      }
      

      Error:

      {
          "id": 1,
          "jsonrpc": "2.0",
          "error": {
              "code": -32603,
              "message": "Internal error: There was an validation error",
              "data": {
                  "file_content": "(The provided property is virtual and can not be updated via API. Please provide a valid definition.) "
              }
          }
      }
      
      • Creating C__CATG__NETWORK_PORT including 'addresses' property
      {
        "version": "2.0",
        "method": "cmdb.category.save",
        "params": {
          "apikey": "XXXXX",
          "language": "en",
          "object": 1334,
          "category": "C__CATG__NETWORK_PORT",
          "data": {
            "title": "eth0",
            "port_type": "Ethernet",
            "addresses": 209
          }
        },
          "id": 1
      }
      

      Error:

      {
          "id": 1,
          "jsonrpc": "2.0",
          "error": {
              "code": -32603,
              "message": "Internal error: There was an validation error",
              "data": {
                  "addresses": "(The provided property is virtual and can not be updated via API. Please provide a valid definition.) "
              }
          }
      }
      
      posted in Development
      F
      fa__
    • XML export

      Hello,

      I'm exploring different ways of exporting and importing data from i-doit.
      I've seen the XML import option. Is it also possible to export data as XML?

      posted in General
      F
      fa__
    • RE: Tag vs Object Group

      In this topic, it is explained how to manage tags using the API. The limitations in the use of tags I mention in my previous post do not exist.

      However, I am still wondering about the consequences of using tags vs object groups.

      posted in General
      F
      fa__
    • RE: Manage tags using API

      Thanks @michael-overkamp!

      I had not undestood that multiselect is a Dialog+, I thought it was a different kind of attribute.

      posted in General
      F
      fa__
    • RE: Create dynamic host address through API

      Thanks @michael-overkamp!
      It works fine.

      posted in General
      F
      fa__
    • RE: Software assignment with license not working

      Hi @philipp-hörselmann,

      Yes, I was using the ID of the license object.
      It works fine with the license entry ID.

      Thank you!

      posted in General
      F
      fa__
    • RE: Software assignment with license not working

      Hello @philipp-hörselmann,

      I am using i-doit Version 1.16 OPEN with API add-on version 1.12.1.

      I have also tested this on https://demo.i-doit.com/ with the same result.

      Best regards

      posted in General
      F
      fa__
    • Software assignment with license not working

      Hello,

      I have not been able to assign a license to an application when creating a software assignment category. I have detected that title-based assignment is not supported and id-based assignment returns an error.

      My attempt in i-doit demo:

      {
          "version": "2.0",
         "method": "cmdb.category.save",
          "params": {
              "object": 1412,
              "category": "C__CATG__APPLICATION",
              "data": {
                          "application": 477,
                          "assigned_version": 22,
                          "assigned_license": 2988
              },
              "apikey": "c1ia5q",
              "language": "en"
          },
          "id": 1
      }
      
      {
          "id": 1,
          "jsonrpc": "2.0",
          "error": {
              "code": -32603,
              "message": "Internal error: An database error occurred that indicates that you provided an Id which does not exist. \n                                             Please check all properties which are referencing an entry for validity: FOREIGN KEY (`isys_catg_application_list__isys_cats_lic_list__id`) REFERENCES `isys_cats_lic_)",
              "data": {
                  "mysqlErrorCode": 1452,
                  "mysqlErrorMessage": "Database error : Query error: 'INSERT INTO isys_catg_application_list SET\n\t\t\tisys_catg_application_list__isys_connection__id = 5180,\n\t\t\tisys_catg_application_list__isys_obj__id = 1412,\n\t\t\tisys_catg_application_list__description = '',\n\t\t\tisys_catg_application_list__status = 2,\n\t\t\tisys_catg_application_list__isys_cats_app_variant_list__id = NULL,\n\t\t\tisys_catg_application_list__isys_cats_lic_list__id = 2988,\n\t\t\tisys_catg_application_list__bequest_nagios_services = 0,\n\t\t\tisys_catg_application_list__isys_catg_application_type__id = 1,\n\t\t\tisys_catg_application_list__isys_catg_application_priority__id = NULL,\n\t\t\tisys_catg_application_list__isys_catg_version_list__id = 22;':\nCannot add or update a child row: a foreign key constraint fails (`idoit_demo_data_pro`.`isys_catg_application_list`, CONSTRAINT `isys_catg_application_list_ibfk_7` FOREIGN KEY (`isys_catg_application_list__isys_cats_lic_list__id`) REFERENCES `isys_cats_lic_)\n"
              }
          }
      }
      

      The same query works fine when "assigned_license" is removed. This license assignment can be done on the web without issues.

      posted in General
      F
      fa__
    • Manage tags using API

      Hello,

      I'm testing the use of tags. I have created a different topic to ask about the purpose of tags but I believe it is worthy to ask separately about the use of tags through the API.

      As tags are attributes of the General category, I would expect to retrieve tags using cmdb.object.read. However, it is not the case. I would also expect to be able to assign tags to an object using cmdb.object.create. It hasn't worked for me either.

      I have considered that the issue may be related to the fact that tags is a multiselect attribute. So, I have checked another multiselect attribute (fiber_wave_lengths of category Cabling-> Connectors). The values can be retrieved as expected with cmdb.category.read but title-based creation is not allowed and the only way I have found to retrieve the id of the possible values for the attribute is to read them from an object where it has previously been manually assigned. This is not convenient.

      Questions:

      • Is it possible to work with tags using the API? What am I doing wrong?

      • Is it possible to retrieve the list of values that can be assigned to a multiselect attribute?

      My attempts:

      1. I have created an object in the i-doit demo and manually assigned a tag
        0edb9c30-52d6-4303-90d7-269e2e5fcbe8-imagen.png

      2. Trying to read the tags with cmdb.object.read:

          {
             "version": "2.0",
             "method": "cmdb.object.read",
             "params": {
                 "objID": 5385,
                 "apikey": "c1ia5q",
                 "language": "en"
              },
            "id": 1
         }
        
        {
            "id": 1,
            "jsonrpc": "2.0",
            "result": {
                "id": 5385,
                "title": "Host 1",
                "sysid": "CLOUD_0005385",
                "objecttype": 39,
                "type_title": "Host",
                "type_icon": "images/icons/silk/server.png",
                "status": 2,
                "cmdb_status": 6,
                "cmdb_status_title": "in operation",
                "created": "2021-06-17 09:51:47",
                "updated": "2021-06-17 09:52:47",
                "image": "https://demo.i-doit.com/images/objecttypes/server.png"
            }
        }
        
      3. Trying to create an object with an existing tag.

        {
           "version": "2.0",
           "method": "cmdb.object.create",
           "params": {
                "type": "C__OBJTYPE__HOST",
                "title": "Host 2",
                "tag": "asdasd", 
                "apikey": "c1ia5q",
                "language": "en"
            },
            "id": 1
        }
        
        
        {
            "id": 1,
            "jsonrpc": "2.0",
            "result": {
                "id": 5391,
                "message": "Object was successfully created",
                "success": true
            }
        }
        
      4. Checking the object created in the web
        b0231ac1-e8fc-4b1c-aeaf-30ea8ecb4374-imagen.png

      posted in General
      F
      fa__
    • Tag vs Object Group

      Hello,

      I need to organize some of my objects in groups and I am wondering what are the consequences of using tags and object groups. Object management through API is important in my case.

      As far as I understand, object groups seem easier to manage. As they are objects, they can be created, modified and have objects assigned through the API. Moreover, obtaining the list of objects in a group is also straightforward.

      On the other hand, tags are not objects but attributes of the General category. Tags are not returned by cmdb.object.read and as far as I have tested, they cannot be assigned in cmdb.object.create. The list of objects in a tag can be retrieved using idoit.search and filtering the results that do belong to the tag.

      Are there any other consequences of using one or the other?
      Have tags a different purpose than grouping objects under a certain category?

      posted in General
      F
      fa__
    • RE: Software assignment with version not always working

      Hello @lfischer,

      You're right. It fails when there exists another software with a version with the same name.
      It only works for the first application where a version name is defined.

      I can also confirm that issue is not only for numeric values, names as the one you suggest also fail.

      As an alternative, what does work is to include the version id in the query, instead of the version title. In the case described in my first post, the following query works fine:

      {
          "version": "2.0",
         "method": "cmdb.category.save",
          "params": {
              "object": 1829,
              "category": "C__CATG__APPLICATION",
              "data": {
                  "application": 1866,
                  "assigned_version":20
              },
              "apikey": XXXX,
              "language": "en"
          },
          "id": 1
      }
      
      posted in Development
      F
      fa__
    • Software assignment with version not always working

      I have detected that I am not able to set the version of some applications when assigning them to a device. It does not happen with all of them and I have not been able to reproduce the issue in the demo. Is there any configuration parameter related to this behavior?

      Here, I include an example of how I retrieve the application versions and assign one of them to a device. Then, when I retrieve the software assignment of the device the version is empty. It appears in the same way in the web interface. It is treated as if the assigned_version did not exist.

      • Read versions of application
      {
          "version": "2.0",
         "method": "cmdb.category.read",
          "params": {
              "objID": 1866,
              "category": "C__CATG__VERSION",
              "apikey": XXXX,
              "language": "en"
          },
          "id": 1
      }
      
      {
          "id": 1,
          "jsonrpc": "2.0",
          "result": [
              {
                  "id": "20",
                  "objID": "1866",
                  "title": "1.0.0",
                  "servicepack": "",
                  "kernel": "",
                  "patchlevel": "",
                  "description": ""
              }
          ]
      }
      
      • Assign application with version to device
      {
          "version": "2.0",
         "method": "cmdb.category.save",
          "params": {
              "object": 1829,
              "category": "C__CATG__APPLICATION",
              "data": {
                  "application": 1866,
                  "assigned_version":"1.0.0"
              },
              "apikey": XXXX,
              "language": "en"
          },
          "id": 1
      }
      
      
      {
          "id": 1,
          "jsonrpc": "2.0",
          "result": {
              "success": true,
              "message": "Category entry successfully saved",
              "entry": 194
          }
      }
      
      • Check software assigned to device
      {
          "version": "2.0",
         "method": "cmdb.category.read",
          "params": {
              "objID": 1829,
              "category": "C__CATG__APPLICATION",
              "apikey": XXXX,
              "language": "en"
          },
          "id": 1
      }
      
      {
          "id": 1,
          "jsonrpc": "2.0",
          "result": [
              {
                  "id": "194",
                  "objID": "1829",
                  "application": {
                      "title": "App2",
                      "id": "1866",
                      "connection_id": "322",
                      "type": "C__OBJTYPE__APPLICATION",
                      "type_title": "Application",
                      "sysid": "SYSID_1623405979"
                  },
                  "application_type": {
                      "id": "1",
                      "title": "Software",
                      "const": "C__CATG__APPLICATION_TYPE__SOFTWARE",
                      "title_lang": "LC__CATG__APPLICATION_TYPE__SOFTWARE"
                  },
                  "application_priority": null,
                  "assigned_license": false,
                  "assigned_license_key": null,
                  "assigned_database_schema": false,
                  "assigned_it_service": false,
                  "assigned_variant": null,
                  "assigned_version": null,
                  "bequest_nagios_services": {
                      "value": "0",
                      "title": "No"
                  },
                  "assigned_databases": null,
                  "description": ""
              }
          ]
      }
      
      posted in Development
      F
      fa__
    • Create dynamic host address through API

      Hello,

      I would like to create a Host Address through the API that includes DHCP allocation.
      I only have been able to create Host Adresseses marked as static. I have no issues setting the assignment I choose in the web interface.
      The attribute "ipv4_assignment" only accepts the values in the dialog "IP: Assignment" () but regardless of the value I send, the Host Address is always static.

      This is one of my attempts to https://demo.i-doit.com

      {
          "version": "2.0",
         "method": "cmdb.category.save",
          "params": {
              "object": 1412,
              "category": "C__CATG__IP",
              "data": {
                  "net": 20,
                  "ipv4_assignment": "DHCP"
              },
              "apikey": "c1ia5q",
              "language": "en"
          },
          "id": 1
      }
      
      posted in General
      F
      fa__
    • RE: API password encoding

      Thank you @lfischer .
      That solved the issue, now the API returns the password decrypted.

      posted in Development
      F
      fa__
    • API password encoding

      Hello,

      I would like to use the API to retrieve information about our equipment, including passwords.
      Using method cmdb.category.read to get category C__CATG__PASSWD returns a password field that seems to be the password encoded. However, I have not been able to identify the encoding. What kind of encoding is it? How should I decode a password obtained through API?

      posted in Development
      F
      fa__