for service in missing_services: name = service["Service Name"].replace(".csv", "")[:100] supplier_id = service["Supplier ID"] lot = { "Software": "cloud-software", "Support": "cloud-support", }.get(service["Lot"]) if not lot: print( f"No lot for '{name}'/'{service['File Name']}' - {supplier_id}" ) continue if args["--dry-run"]: print(f"Would create '{name}'") continue new_draft = api_client.create_new_draft_service( "g-cloud-12", lot, supplier_id, {"serviceName": name})["services"] print(f"Created '{name}': {new_draft['id']}") service["serviceId"] = str(new_draft["id"]) print([s.get("serviceId") for s in services]) with open(args["<output_file>"], "w") as output_file: writer = csv.DictWriter(output_file, services[0].keys()) writer.writeheader() writer.writerows(services)
data_api_client.set_supplier_declaration( supplier_id=supplier_id, framework_slug=args.new_slug, declaration=eligible_g9_declaration_base(), user=identity) suppliers_prepared.add(supplier_id) fake_service = gcloud_service_faker.generate_from_file( filepath_service_lot_schema(args.validation_schema_path, args.new_slug, random_lot)) fake_service['serviceName'] = gen_gcloud_name() draft_service = data_api_client.create_new_draft_service( framework_slug=args.new_slug, lot=random_lot, supplier_id=supplier_id, data=fake_service, user=identity) data_api_client.complete_draft_service( draft_id=draft_service['services']['id'], user=identity) services_generated += 1 # 4) Set a given (new) framework to standstill data_api_client._post_with_updated_by( url='{}/frameworks/{}'.format(data_api_url, args.new_slug), data={"frameworks": { "status": "standstill" }}, user=identity)