8 Copyright (C) The Arvados Authors. All rights reserved.
10 SPDX-License-Identifier: CC-BY-SA-3.0
16 import org.arvados.sdk.Arvados;
20 String apiName = "arvados";
21 String apiVersion = "v1";
23 Arvados arv = new Arvados(apiName, apiVersion);
29 Map<String, String> collection = new HashMap<String, String>();
30 collection.put("name", "create example");
32 Map<String, Object> params = new HashMap<String, Object>();
33 params.put("collection", collection);
34 Map response = arv.call("collections", "create", params);
40 Map<String, Object> params = new HashMap<String, Object>();
41 params.put("uuid", uuid);
42 Map response = arv.call("collections", "delete", params);
48 params = new HashMap<String, Object>();
49 params.put("uuid", userUuid);
50 Map response = arv.call("users", "get", params);
56 Map<String, Object> params = new HashMap<String, Object>();
57 Map response = arv.call("users", "list", params);
59 // get uuid of the first user from the response
60 List items = (List)response.get("items");
62 Map firstUser = (Map)items.get(0);
63 String userUuid = (String)firstUser.get("uuid");
69 Map<String, String> collection = new HashMap<String, String>();
70 collection.put("name", "update example");
72 Map<String, Object> params = new HashMap<String, Object>();
73 params.put("uuid", uuid);
74 params.put("collection", collection);
75 Map response = arv.call("collections", "update", params);
81 Map<String, Object> params = new HashMap<String, Object>();
82 Map response = arv.call("users", "current", params);