EN
Español
English
Português
    sys_user

    The “sys_user” class referenced by the “cmdb_ci_computer” class assigns a user to the registered device, in case the user does not exist it will create it.



    Map the “sys_user” class in the configuration file

    {
      "searchBy": [
        "user_name"
      ],
      "name": "sys_user",
      "fields": [
        {
          "type": "string",
          "name": "first_name",
          "mappingType": "Mapper",
          "mappingName": null,
          "isRequired": true,
          "classReference": null
        },
        {
          "type": "string",
          "name": "last_name",
          "mappingType": "Mapper",
          "mappingName": null,
          "isRequired": true,
          "classReference": null
        },
        {
          "type": "string",
          "name": "user_name",
          "mappingType": "Mapper",
          "mappingName": null,
          "isRequired": true,
          "classReference": null
        }
      ]
    }
    

    The parameters I take from the device information are as follows:

    {
      "mapper": [
        {
          "name": "UserDeviceReference",
          "fields": [
            {
              "fieldDevice": "responsibleUserName",
              "fieldCMDB": "first_name"
            },
            {
              "fieldDevice": "responsibleUserName",
              "fieldCMDB": "last_name"
            },
            {
              "fieldDevice": "userName",
              "fieldCMDB": "user_name"
            },
            {
              "fieldDevice": "responsibleUserEmail",
              "fieldCMDB": "email"
            }
          ]
        }
      ],
      "classCMDB": [
        {
          "searchBy": [
            "object_id"
          ],
          "name": "cmdb_ci_computer",
          "fields": [
            {
              "type": "string",
              "name": "assigned_to",
              "mappingType": "Reference",
              "mappingName": "UserDeviceReference",
              "isRequired": false,
              "classReference": "sys_user"
            }
          ]
        }
      ]
    }