diff --git a/tools/batch_print/README.md b/tools/batch_print/README.md new file mode 100644 index 0000000..6053caf --- /dev/null +++ b/tools/batch_print/README.md @@ -0,0 +1,26 @@ +# Batch Print + +This Script will register a batch of devices in Snipe IT and print the label. + +It requires a JSON file in the following format to register the data: + +``` +{ + "status_id": "2", + "name": "HP-Tablet", + "model_id": "2", + "serial": "Null", + "_snipeit_mac_address_1": "Null", + "_snipeit_betriebssystem_2": "Windows 11", + "_snipeit_festplatte_4": "128", + "_snipeit_prozessor_5": "Intel Pentium 4410 1.5ghz", + "_snipeit_arbeitsspeicher_6": "4", + "_snipeit_optisches_laufwerk_7": "nein", + "_snipeit_display_8": "", + "_snipeit_akku_9": "", + "_snipeit_anydeskid_10": "" +} +``` +Usage: + +`python print.py -j {path to json file} -i {amount of devices that should be registered}` diff --git a/tools/batch_print/print.py b/tools/batch_print/print.py index e1544df..da8fc6b 100644 --- a/tools/batch_print/print.py +++ b/tools/batch_print/print.py @@ -114,9 +114,9 @@ def main(): "id": tag, "distribution": "Windows", "version": "11", - "cpu": "Intel Pentium 4410 1.5ghz", - "memory": "4", - "disk": "128" + "cpu": data["_snipeit_prozessor_5"], + "memory": data["_snipeit_arbeitsspeicher_6"], + "disk": data["_snipeit_festplatte_4"] } res = requests.post("http://10.200.4.12:8888/batch", data=json.dumps(print_data)) print(res.content)