mirror of https://github.com/apache/lucene.git
199 lines
5.7 KiB
Plaintext
199 lines
5.7 KiB
Plaintext
= ConfigSets API
|
|
:page-shortname: configsets-api
|
|
:page-permalink: configsets-api.html
|
|
// Licensed to the Apache Software Foundation (ASF) under one
|
|
// or more contributor license agreements. See the NOTICE file
|
|
// distributed with this work for additional information
|
|
// regarding copyright ownership. The ASF licenses this file
|
|
// to you under the Apache License, Version 2.0 (the
|
|
// "License"); you may not use this file except in compliance
|
|
// with the License. You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing,
|
|
// software distributed under the License is distributed on an
|
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
// KIND, either express or implied. See the License for the
|
|
// specific language governing permissions and limitations
|
|
// under the License.
|
|
|
|
The ConfigSets API enables you to create, delete, and otherwise manage ConfigSets.
|
|
|
|
To use a ConfigSet created with this API as the configuration for a collection, use the <<collections-api.adoc#collections-api,Collections API>>.
|
|
|
|
This API can only be used with Solr running in SolrCloud mode. If you are not running Solr in SolrCloud mode but would still like to use shared configurations, please see the section <<config-sets.adoc#config-sets,Config Sets>>.
|
|
|
|
[[ConfigSetsAPI-APIEntryPoints]]
|
|
== API Entry Points
|
|
|
|
The base URL for all API calls is `\http://<hostname>:<port>/solr`.
|
|
|
|
* `/admin/configs?action=CREATE`: <<ConfigSetsAPI-create,create>> a ConfigSet, based on an existing ConfigSet
|
|
* `/admin/configs?action=DELETE`: <<ConfigSetsAPI-delete,delete>> a ConfigSet
|
|
* `/admin/configs?action=LIST`: <<ConfigSetsAPI-list,list>> all ConfigSets
|
|
* `/admin/configs?action=UPLOAD`: <<ConfigSetsAPI-upload,upload>> a ConfigSet
|
|
|
|
[[ConfigSetsAPI-createCreateaConfigSet]]
|
|
|
|
[[ConfigSetsAPI-create]]
|
|
== Create a ConfigSet
|
|
|
|
`/admin/configs?action=CREATE&name=_name_&baseConfigSet=_baseConfigSet_`
|
|
|
|
Create a ConfigSet, based on an existing ConfigSet.
|
|
|
|
[[ConfigSetsAPI-Input]]
|
|
=== Input
|
|
|
|
The following parameters are supported when creating a ConfigSet.
|
|
|
|
name:: The ConfigSet to be created. This parameter is required.
|
|
|
|
baseConfigSet:: The ConfigSet to copy as a base. This parameter is required.
|
|
|
|
configSetProp._name_=_value_:: Any ConfigSet property from base to override.
|
|
|
|
[[ConfigSetsAPI-Output]]
|
|
=== Output
|
|
|
|
*Output Content*
|
|
|
|
The output will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.
|
|
|
|
[[ConfigSetsAPI-Examples]]
|
|
=== Examples
|
|
|
|
*Input*
|
|
|
|
Create a ConfigSet named 'myConfigSet' based on a 'predefinedTemplate' ConfigSet, overriding the immutable property to false.
|
|
|
|
[source,text]
|
|
----
|
|
http://localhost:8983/solr/admin/configs?action=CREATE&name=myConfigSet&baseConfigSet=predefinedTemplate&configSetProp.immutable=false
|
|
----
|
|
|
|
*Output*
|
|
|
|
[source,xml]
|
|
----
|
|
<response>
|
|
<lst name="responseHeader">
|
|
<int name="status">0</int>
|
|
<int name="QTime">323</int>
|
|
</lst>
|
|
</response>
|
|
----
|
|
|
|
[[ConfigSetsAPI-deleteDeleteaConfigSet]]
|
|
|
|
[[ConfigSetsAPI-delete]]
|
|
== Delete a ConfigSet
|
|
|
|
`/admin/configs?action=DELETE&name=_name_`
|
|
|
|
Delete a ConfigSet
|
|
|
|
[[ConfigSetsAPI-Input.1]]
|
|
=== Input
|
|
|
|
*Query Parameters*
|
|
|
|
name:: The ConfigSet to be deleted. This parameter is required.
|
|
|
|
[[ConfigSetsAPI-Output.1]]
|
|
=== Output
|
|
|
|
*Output Content*
|
|
|
|
The output will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.
|
|
|
|
[[ConfigSetsAPI-Examples.1]]
|
|
=== Examples
|
|
|
|
*Input*
|
|
|
|
Delete ConfigSet 'myConfigSet'
|
|
|
|
[source,text]
|
|
----
|
|
http://localhost:8983/solr/admin/configs?action=DELETE&name=myConfigSet
|
|
----
|
|
|
|
*Output*
|
|
|
|
[source,xml]
|
|
----
|
|
<response>
|
|
<lst name="responseHeader">
|
|
<int name="status">0</int>
|
|
<int name="QTime">170</int>
|
|
</lst>
|
|
</response>
|
|
----
|
|
|
|
[[ConfigSetsAPI-list]]
|
|
== List ConfigSets
|
|
|
|
`/admin/configs?action=LIST`
|
|
|
|
Fetch the names of the ConfigSets in the cluster.
|
|
|
|
[[ConfigSetsAPI-Examples.2]]
|
|
=== Examples
|
|
|
|
*Input*
|
|
|
|
[source,text]
|
|
----
|
|
http://localhost:8983/solr/admin/configs?action=LIST&wt=json
|
|
----
|
|
|
|
*Output*
|
|
|
|
[source,json]
|
|
----
|
|
{
|
|
"responseHeader":{
|
|
"status":0,
|
|
"QTime":203},
|
|
"configSets":["myConfigSet1",
|
|
"myConfig2"]}
|
|
----
|
|
|
|
[[ConfigSetsAPI-upload]]
|
|
== Upload a ConfigSet
|
|
|
|
`/admin/configs?action=UPLOAD&name=_name_`
|
|
|
|
Upload a ConfigSet, sent in as a zipped file. Please note that a ConfigSet is uploaded in a "trusted" mode if authentication is enabled and this upload operation is performed as an authenticated request. Without authentication, a ConfigSet is uploaded in an "untrusted" mode. Upon creation of a collection using an "untrusted" ConfigSet, the following functionality would not work:
|
|
|
|
* RunExecutableListener does not initialize, if specified in the ConfigSet.
|
|
* DataImportHandler's ScriptTransformer does not initialize, if specified in the ConfigSet.
|
|
* XSLT transformer (tr parameter) cannot be used at request processing time.
|
|
* StatelessScriptUpdateProcessor does not initialize, if specified in the ConfigSet.
|
|
|
|
[[ConfigSetsAPI-Input.3]]
|
|
=== Input
|
|
|
|
name:: The ConfigSet to be created when the upload is complete. This parameter is required.
|
|
|
|
The body of the request should contain a zipped config set.
|
|
|
|
[[ConfigSetsAPI-Output.3]]
|
|
=== Output
|
|
|
|
*Output Content*
|
|
|
|
The output will include the status of the request. If the status is anything other than "success", an error message will explain why the request failed.
|
|
|
|
[[ConfigSetsAPI-Examples.3]]
|
|
=== Examples
|
|
|
|
Create a ConfigSet named 'myConfigSet' based on a 'predefinedTemplate' ConfigSet, overriding the immutable property to false.
|
|
|
|
[source,text]
|
|
----
|
|
curl -X POST -d @myconfigset.zip http://localhost:8983/solr/admin/configs?action=CREATE&name=myConfigSet --header "Content-Type:text/xml"
|
|
----
|