Skip to content

Commit 85e93a7

Browse files
Add new examples
1 parent f9d24a0 commit 85e93a7

File tree

1 file changed

+39
-30
lines changed

1 file changed

+39
-30
lines changed

src/main/java/examples/Examples.java

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.openapitools.client.ApiClient;
55
import org.openapitools.client.ApiException;
66
import org.openapitools.client.Configuration;
7-
import org.openapitools.client.api.FilesApi;
7+
import org.openapitools.client.api.GroupsApi;
88
import org.openapitools.client.auth.*;
99
import org.openapitools.client.api.ArrayApi;
1010
import org.openapitools.client.model.ArrayInfo;
@@ -17,15 +17,13 @@
1717
import org.openapitools.client.model.DimensionTileExtent;
1818
import org.openapitools.client.model.Domain;
1919
import org.openapitools.client.model.DomainArray;
20-
import org.openapitools.client.model.FileExport;
21-
import org.openapitools.client.model.FileExported;
22-
import org.openapitools.client.model.FileUploaded;
2320
import org.openapitools.client.model.Filter;
2421
import org.openapitools.client.model.FilterPipeline;
2522
import org.openapitools.client.model.FilterType;
23+
import org.openapitools.client.model.GroupBrowserData;
2624
import org.openapitools.client.model.Layout;
2725

28-
import java.io.File;
26+
import java.util.List;
2927

3028
public class Examples
3129
{
@@ -35,57 +33,68 @@ public static void main(String[] args) {
3533

3634
// Configure API key authorization: ApiKeyAuth
3735
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
38-
ApiKeyAuth.setApiKey("<ENTER API TOKEN HERE>");
36+
ApiKeyAuth.setApiKey("<API_TOKEN>");
3937

4038
ArrayApi apiInstance = new ArrayApi(defaultClient);
4139

42-
getArraySchema(apiInstance);
43-
createArray(apiInstance);
44-
registerArray(apiInstance);
45-
uploadFile(defaultClient);
46-
exportFile(defaultClient);
47-
40+
// getArraySchema(apiInstance);
41+
// createArray(apiInstance);
42+
// registerArray(apiInstance);
43+
// listArrays(apiInstance);
44+
// listGroups(defaultClient);
4845
}
4946

50-
private static void exportFile(ApiClient defaultClient)
47+
/**
48+
* List groups
49+
* @param defaultClient
50+
*/
51+
private static void listGroups(ApiClient defaultClient)
5152
{
52-
FilesApi apiInstance = new FilesApi(defaultClient);
53-
String namespace = "<TILEDB_NAMESPACE>"; // String | The namespace of the file
54-
String _file = "file"; // String | The file identifier
55-
FileExport fileExport = new FileExport(); // FileExport | Export configuration information
56-
fileExport.setOutputUri("s3://<BUCKET-NAME>/file.txt");
53+
GroupsApi apiInstance = new GroupsApi(defaultClient);
54+
Integer page = null; // Integer | pagination offset
55+
Integer perPage = null; // Integer | pagination limit
56+
String search = null; // String | search string that will look at name, namespace or description fields
57+
String namespace = "TileDB-Inc"; // String | namespace
58+
String orderby = null; // String | sort by which field valid values include last_accessed, size, name
59+
String permissions = null; // String | permissions valid values include read, read_write, write, admin
60+
List<String> tag = null; // List<String> | tag to search for, more than one can be included
61+
List<String> excludeTag = null; // List<String> | tags to exclude matching array in results, more than one can be included
62+
Boolean flat = true; // Boolean | if true, ignores the nesting of groups and searches all of them
63+
String parent = null; // String | search only the children of the groups with this uuid
5764
try {
58-
FileExported result = apiInstance.handleExportFile(namespace, _file, fileExport);
59-
System.out.println(result);
65+
GroupBrowserData result = apiInstance.listPublicGroups(page, perPage, search, namespace, orderby, permissions, tag, excludeTag, flat, parent);
66+
//or use api.listOwnedGroups(...) / api.listSharedGroups(...)
67+
System.out.println(result.getGroups());
6068
} catch (ApiException e) {
61-
System.err.println("Exception when calling FilesApi#handleExportFile");
69+
System.err.println("Exception when calling GroupsApi#listPublicGroups");
6270
System.err.println("Status code: " + e.getCode());
6371
System.err.println("Reason: " + e.getResponseBody());
6472
System.err.println("Response headers: " + e.getResponseHeaders());
6573
e.printStackTrace();
6674
}
67-
}
6875

76+
}
6977

70-
private static void uploadFile(ApiClient defaultClient)
78+
/**
79+
* List arrays
80+
* @param apiInstance
81+
*/
82+
private static void listArrays(ArrayApi apiInstance)
7183
{
72-
FilesApi apiInstance = new FilesApi(defaultClient);
73-
String namespace = "<TILEDB_NAMESPACE>"; // String | The namespace of the file
74-
File inputFile = new File("file.txt"); // File | the file to upload
75-
String outputUri = "s3://<BUCKET-NAME>/file"; // String | output location of the TileDB File
76-
String name = "file"; // String | name to set for registered file
84+
String namespace = "<TILEDB_NAMESPACE>"; // String | namespace array is in (an organization name or user's username)
7785
try {
78-
FileUploaded result = apiInstance.handleUploadFile(namespace, inputFile, "dstara", outputUri, name);
86+
List<ArrayInfo> result = apiInstance.getArraysInNamespace(namespace);
7987
System.out.println(result);
8088
} catch (ApiException e) {
81-
System.err.println("Exception when calling FilesApi#handleUploadFile");
89+
System.err.println("Exception when calling ArrayApi#getArraysInNamespace");
8290
System.err.println("Status code: " + e.getCode());
8391
System.err.println("Reason: " + e.getResponseBody());
8492
System.err.println("Response headers: " + e.getResponseHeaders());
8593
e.printStackTrace();
8694
}
8795
}
8896

97+
8998
private static void getArraySchema(ArrayApi arrayApi){
9099
String namespace = "<TILEDB_NAMESPACE>"; // String | namespace array is in (an organization name or user's username)
91100
String array = "my_array"; // String | name/uri of array that is url-encoded

0 commit comments

Comments
 (0)