Menu

reconciliationkey = id (Primary Key) in comand line

2024-01-31
2024-02-20
  • Ana María  Gutiérrez González

    Hello
    When I send data from itop to update a class with id (Primary Key) it works correctly if i click the advanced mode option. But if I try it through the command line and i put this same rekey, i get a warning that it is not a valid column.

        payload = {
            "auth_user": username,
            "auth_pwd": password,
            "class": clase,
            "charset": "UTF-8",
            "output": "details",
            "reconciliationkeys": rekeys,
            "csvdata": ''.join(csvdata),
        }
    
    "#Unknown column: 'id (Primary Key)'. Possible columns: resource name, description, enterprise, enterprise->name, enterprise->code, enterprise->status, enterprise->parent, enterprise->parent name, enterprise->overview, enterprise->investee company, enterprise->source, enterprise->ctm code, .....
    

    Is it possible to activate advanced mode by command line?

     
  • Ana María  Gutiérrez González

    Sorry , thank you very much

     
  • Pierre Goiffon

    Pierre Goiffon - 2024-02-02

    Hello,
    Seems you are talking about the CSV import using CLI ?
    Does your second message means you found the solution ?

     
  • Ana María  Gutiérrez González

    Hello. yes, I was asking about importing via CLI. And no, I have not found a solution. Your response gives me hope that such a solution exists. Please, I accept suggestions. I was thinking of doing it with some method in the extension's datamodel, but it turned out to be much more cumbersome. This time, I will say thank you before closing the consultation. ha ha ha Greetings and thank you very much.

     
  • Pierre Goiffon

    Pierre Goiffon - 2024-02-02

    Ok :)
    Did you check the corresponding documentation page ? Import data via CLI [iTop Documentation]
    If still no solution, share everything that is needed to reproduce ?

     
  • Ana María  Gutiérrez González

    Hello.
    I try to load organization.csv with this data:
    id (Primary Key),name
    2,obs_GLOBAL

    I reread the documentation and the only parameter that I think could be related to the problem was no_localize. I did tests with its two values ​​0 and 1.
    But he always says he doesn't recognize the column.
    I pass image of the error and image of how from the application if it loads correctly.

     
  • Pierre Goiffon

    Pierre Goiffon - 2024-02-13

    Can you share a file sample, and the command used ?

     
  • Ana María  Gutiérrez González

    Hi Pierre.
    I am trying it with the shell screen command:
    php ./webservices/import.php --auth_user='user' --auth_pwd='password' --class=Organization --csvfile='Organization.csv' --reconciliationkeys='id (Primary Key)

    php ./webservices/import.php --auth_user='user' --auth_pwd='password' --class=Organization --csvfile='Organization.csv' --reconciliationkeys='id (Primary Key) --no_localice=0

    php ./webservices/import.php --auth_user='user' --auth_pwd='password' --class=Organization --csvfile='Organization.csv' --reconciliationkeys='id (Primary Key) --no_localice=1

    and the attached file Organization.csv

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2024-02-20

    Mind there's at least also a typo; the argument is no_localize (with a Z)

     

Log in to post a comment.