blob: b4545d33f253a9f28a9be1e5b6126c5c523c90bb [file] [log] [blame]
{
"documentation": "https://lucene.apache.org/solr/guide/collections-api.html",
"description": "Several collection-level operations are supported with this endpoint: modify collection attributes; reload a collection; migrate documents to a different collection; rebalance collection leaders; balance properties across shards; and add or delete a replica property.",
"methods": [
"POST"
],
"url": {
"paths": [
"/collections/{collection}",
"/c/{collection}"
]
},
"commands": {
"modify": {
"#include": "collections.collection.Commands.modify"
},
"reload": {
"#include": "collections.collection.Commands.reload"
},
"move-replica": {
"type": "object",
"documentation": "https://lucene.apache.org/solr/guide/replica-management.html#movereplica",
"description": "This command moves a replica from one node to a new node. In case of shared filesystems the `dataDir` and `ulogDir` may be reused.",
"properties": {
"replica": {
"type": "string",
"description": "The name of the replica to move. Either this parameter or shard + sourceNode is required, this parameter takes precedence."
},
"shard": {
"type": "string",
"description": "The name of the shard for which a replica should be moved. Either this parameter or replica is required. If replica is specified, this parameter is ignored."
},
"sourceNode": {
"type": "string",
"description": "The name of the node that contains the replica. Either this parameter or replica is required. If replica is specified, this parameter is ignored."
},
"targetNode": {
"type": "string",
"description": "The name of the destination node. This parameter is required."
},
"waitForFinalState": {
"type": "boolean",
"default": "false",
"description": "Wait for the moved replica to become active."
},
"timeout": {
"type": "integer",
"default": 600,
"description": "Number of seconds to wait for replica to become active before failing. For very large replicas this may need to be increased to ensure the old replica is deleted. Ignored for hdfs replicas."
},
"inPlaceMove": {
"type": "boolean",
"default": "true",
"description": "For replicas that use shared filesystems allow 'in-place' move that reuses shared data."
}
}
},
"migrate-docs":{
"type":"object",
"documentation":"https://lucene.apache.org/solr/guide/collection-management.html#migrate",
"description": "Moves documents with a given routing key to another collection. The source collection will continue to have the same documents, but will start re-routing write requests to the new collection. This command only works on collections using the 'compositeId' type of document routing.",
"properties":{
"target":{
"type":"string",
"description":"The name of the collection to which documents will be migrated."
},
"splitKey":{
"type":"string",
"description":"The routing key prefix. For example, if uniqueKey is a!123, then you would use split.key=a! This key may span multiple shards on source and target collections. The migration will be completed shard-by-shard in a single thread."
},
"forwardTimeout":{
"type":"integer",
"description":"The timeout, in seconds, until which write requests made to the source collection for the given splitKey will be forwarded to the target shard. Once this time is up, write requests will be routed to the target collection. Any applications sending read or write requests should be modified once the migration is complete to send documents to the right collection.",
"default": "60"
},
"async": {
"type": "string",
"description": "Defines a request ID that can be used to track this action after it's submitted. The action will be processed asynchronously when this is defined. This command can be long-running, so running it asynchronously is recommended."
}
},
"required":["target", "splitKey"]
},
"balance-shard-unique":{
"type":"object",
"documentation": "https://lucene.apache.org/solr/guide/cluster-node-management.html#balanceshardunique",
"description": "Ensures a property is distributed equally across all physical nodes of a collection. If the property already exists on a replica, effort is made to leave it there. However, if it does not exist on any repica, a shard will be chosen and the property added.",
"properties":{
"property":{
"type":"string",
"description": "The property to balance across nodes. This can be entered as 'property.<property>' or simply '<property>'. If the 'property.' prefix is not defined, it will be added automatically."
},
"onlyactivenodes":{
"type":"boolean",
"description": "Normally, a property is instantiated on active nodes only. If this parameter is specified as 'false', then inactive nodes are also included for distribution.",
"default": "true"
},
"shardUnique":{
"type":"boolean",
"description": "There is one pre-defined property (preferredLeader) that defaults this value to 'true'. For all other properties that are balanced, this must be set to 'true' or an error message is returned."
}
},
"required":["property"]
},
"rebalance-leaders" :{
"type":"object",
"documentation": "https://lucene.apache.org/solr/guide/replica-management.html#rebalanceleaders",
"description": "Reassign leaders in a collection according to the preferredLeader property across active nodes. This command should be run after the preferredLeader property has been set with the balance-shards or add-replica-property commands.",
"properties":{
"maxAtOnce":{
"type":"integer",
"description":"The maximum number of reassignments to have in the queue at one time. Values <=0 use the default value Integer.MAX_VALUE. When this number is reached, the process waits for one or more leaders to be successfully assigned before adding more to the queue."
},
"maxWaitSeconds":{
"type":"integer",
"description":"Timeout, in seconds, when waiting for leaders to be reassigned. If maxAtOnce is less than the number of reassignments pending, this is the maximum interval for any single reassignment.",
"default": "60"
}
}
},
"add-replica-property": {
"documentation": "https://lucene.apache.org/solr/guide/replica-management.html#addreplicaprop",
"description": "Assign an arbitrary property to a particular replica and give it the value specified. If the property already exists, it will be overwritten with the new value.",
"type": "object",
"properties": {
"shard": {
"type": "string",
"description": "The name of the shard the replica belongs to."
},
"replica": {
"type": "string",
"description": "The name of the replica."
},
"name": {
"type": "string",
"description": "The name of the property. This can be entered as 'property.<property>' or simply '<property>'. If the 'property.' prefix is not defined, it will be added automatically."
},
"value": {
"type": "string",
"description": "The value to assign to the property."
},
"shardUnique": {
"type": "boolean",
"description": "If true, setting this property in one replica will remove the property from all other replicas in that shard.",
"default": "false"
}
},
"required": [
"name",
"value",
"shard",
"replica"
]
},
"delete-replica-property": {
"description": "Deletes an arbitrary property from a particular replica",
"documentation": "https://lucene.apache.org/solr/guide/replica-management.html#deletereplicaprop",
"type": "object",
"properties": {
"shard": {
"type": "string",
"description": "The name of the shard the replica belongs to."
},
"replica": {
"type": "string",
"description": "The name of the replica."
},
"property": {
"type": "string",
"description": "The name of the property to remove."
}
},
"required":["shard","replica","property"]
},
"set-collection-property": {
"documentation": "https://lucene.apache.org/solr/guide/collection-management.html#collectionprop",
"description": "Sets a property for the collection",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the property"
},
"value": {
"type": "string",
"description": "The value of the property. When not provided, the property is deleted"
}
},
"required": [
"name"
]
}
}
}