2022-11-15 16:25:18 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import json
|
2022-11-17 17:08:20 +00:00
|
|
|
|
|
|
|
from helpers.neofs_cli import get_object
|
2022-11-15 16:25:18 +00:00
|
|
|
|
|
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument('--endpoint', help='Node address')
|
|
|
|
parser.add_argument('--preset_json', help='JSON file path with preset')
|
|
|
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
with open(args.preset_json) as f:
|
|
|
|
preset_text = f.read()
|
|
|
|
|
|
|
|
preset = json.loads(preset_text)
|
|
|
|
|
|
|
|
success_objs = 0
|
|
|
|
failed_objs = 0
|
|
|
|
|
|
|
|
for obj in preset.get('objects'):
|
|
|
|
oid = obj.get('object')
|
|
|
|
cid = obj.get('container')
|
|
|
|
|
2022-11-17 17:08:20 +00:00
|
|
|
rst = get_object(cid, oid, args.endpoint, "/dev/null")
|
2022-11-15 16:25:18 +00:00
|
|
|
|
2022-11-17 17:08:20 +00:00
|
|
|
if rst:
|
2022-11-15 16:25:18 +00:00
|
|
|
success_objs += 1
|
|
|
|
else:
|
|
|
|
failed_objs += 1
|
|
|
|
|
|
|
|
print(f'Success objects: {success_objs}')
|
|
|
|
print(f'Failed objects: {failed_objs}')
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2022-11-17 17:08:20 +00:00
|
|
|
main()
|