forked from typedb/typedb-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypedb.yml
103 lines (103 loc) · 4.21 KB
/
typedb.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
methods:
- method:
common: &method-client-core
title: Instantiating a TypeDB Core client
description: |
In order to communicate with TypeDB Core databases via sessions and transactions, we first need to instantiate a TypeDB Core client.
The created object connects our application with the running TypeDB Server.
accepts: &accepts-client-core
param1: &accepts-client-core-uri
name: address
description: The address (host:port) on which the TypeDB Server is running
type: String
required: true
param2: &accepts-client-core-parallelisation
name: parallelisation
description: The number of threads to use for server communication
type: int
required: false
default: Scales based on host machine's number of available CPU cores
returns:
- "[Client](#client)"
java:
<<: *method-client-core
method: TypeDB.coreClient(String address, int parallelisation);
javascript:
<<: *method-client-core
method: TypeDB.coreClient(address);
accepts:
param1:
<<: *accepts-client-core-uri
python:
<<: *method-client-core
method: TypeDB.core_client(address, parallelisation)
accepts:
param1:
<<: *accepts-client-core-uri
param2:
<<: *accepts-client-core-parallelisation
default: 2
- method:
common: &method-client-cluster
title: Instantiating a TypeDB Cluster client
description: |
In order to communicate with TypeDB Cluster databases via sessions and transactions, we first need to instantiate a TypeDB Cluster client.
The created object connects our application with the running TypeDB Cluster.
Please note that Node.js and Python clients always have TLS enabled, and therefore can only connect to a server that is setup with TLS.
When instantiating a TypeDB Cluster client, it is sufficient to supply the address of just one server, as the addresses of the other
servers will be relayed back to the client. However, to avoid failure in the unlikely event that the single server whose address is provided
fails before communicating the addresses of the others, it is best practice to supply addresses of all the servers.
accepts: &accepts-client-cluster
param1: &accepts-client-cluster-addresses
name: addresses
description: Addresses (host:port) on which TypeDB Cluster nodes are running
type: Set<String>
required: true
param2: &accepts-client-cluster-credential
name: credential
description: User credential and TLS encryption setting
type: TypeDBCredential
required: true
param3: &accepts-client-cluster-parallelisation
name: parallelisation
description: The number of threads to use for server communication
type: int
required: false
default: Scales based on host machine's number of available CPU cores
returns:
- "[Client](#client)"
java:
<<: *method-client-cluster
method: TypeDB.clusterClient(Set<String> addresses, TypeDBCredential credential, int parallelisation);
accepts:
param1:
<<: *accepts-client-cluster-addresses
type: Set of String
param2:
<<: *accepts-client-cluster-credential
type: TypeDBCredential
param3:
<<: *accepts-client-cluster-parallelisation
javascript:
<<: *method-client-cluster
method: TypeDB.clusterClient(addresses, credential)
accepts:
param1:
<<: *accepts-client-cluster-addresses
type: Array of String
param2:
<<: *accepts-client-cluster-credential
type: TypeDBCredential
python:
<<: *method-client-cluster
method: TypeDB.cluster_client(addresses, credential, parallelisation)
accepts:
param1:
<<: *accepts-client-cluster-addresses
type: list of String
param2:
<<: *accepts-client-cluster-credential
type: TypeDBCredential
param3:
<<: *accepts-client-cluster-parallelisation
default: 2