@@ -1165,8 +1165,11 @@ def create_graph(
1165
1165
edge_definitions : Optional [Sequence [Json ]] = None ,
1166
1166
orphan_collections : Optional [Sequence [str ]] = None ,
1167
1167
smart : Optional [bool ] = None ,
1168
+ disjoint : Optional [bool ] = None ,
1168
1169
smart_field : Optional [str ] = None ,
1169
1170
shard_count : Optional [int ] = None ,
1171
+ replication_factor : Optional [int ] = None ,
1172
+ write_concern : Optional [int ] = None ,
1170
1173
) -> Result [Graph ]:
1171
1174
"""Create a new graph.
1172
1175
@@ -1184,6 +1187,10 @@ def create_graph(
1184
1187
**smart_field** below). Applies only to enterprise version of
1185
1188
ArangoDB.
1186
1189
:type smart: bool | None
1190
+ :param disjoint: If set to True, create a disjoint SmartGraph instead
1191
+ of a regular SmartGraph. Applies only to enterprise version of
1192
+ ArangoDB.
1193
+ :type disjoint: bool | None
1187
1194
:param smart_field: Document field used to shard the vertices of the
1188
1195
graph. To use this, parameter **smart** must be set to True and
1189
1196
every vertex in the graph must have the smart field. Applies only
@@ -1195,6 +1202,21 @@ def create_graph(
1195
1202
cannot be modified later once set. Applies only to enterprise
1196
1203
version of ArangoDB.
1197
1204
:type shard_count: int | None
1205
+ :param replication_factor: Number of copies of each shard on different
1206
+ servers in a cluster. Allowed values are 1 (only one copy is kept
1207
+ and no synchronous replication), and n (n-1 replicas are kept and
1208
+ any two copies are replicated across servers synchronously, meaning
1209
+ every write to the master is copied to all slaves before operation
1210
+ is reported successful).
1211
+ :type replication_factor: int
1212
+ :param write_concern: Write concern for the collection. Determines how
1213
+ many copies of each shard are required to be in sync on different
1214
+ DBServers. If there are less than these many copies in the cluster
1215
+ a shard will refuse to write. Writes to shards with enough
1216
+ up-to-date copies will succeed at the same time. The value of this
1217
+ parameter cannot be larger than that of **replication_factor**.
1218
+ Default value is 1. Used for clusters only.
1219
+ :type write_concern: int
1198
1220
:return: Graph API wrapper.
1199
1221
:rtype: arango.graph.Graph
1200
1222
:raise arango.exceptions.GraphCreateError: If create fails.
@@ -1223,10 +1245,16 @@ def create_graph(
1223
1245
data ["orphanCollections" ] = orphan_collections
1224
1246
if smart is not None : # pragma: no cover
1225
1247
data ["isSmart" ] = smart
1248
+ if disjoint is not None : # pragma: no cover
1249
+ data ["isDisjoint" ] = disjoint
1226
1250
if smart_field is not None : # pragma: no cover
1227
1251
data ["options" ]["smartGraphAttribute" ] = smart_field
1228
1252
if shard_count is not None : # pragma: no cover
1229
1253
data ["options" ]["numberOfShards" ] = shard_count
1254
+ if replication_factor is not None : # pragma: no cover
1255
+ data ["options" ]["replicationFactor" ] = replication_factor
1256
+ if write_concern is not None : # pragma: no cover
1257
+ data ["options" ]["writeConcern" ] = write_concern
1230
1258
1231
1259
request = Request (method = "post" , endpoint = "/_api/gharial" , data = data )
1232
1260
0 commit comments