Create a new data collection or update an existing one
import requests
url = "https://{FUSION_HOST}:8764/api/apollo/collections/{collection}"
payload = {
"createdAt": "2023-11-07T05:31:56Z",
"searchClusterId": "<string>",
"commitWithin": 123,
"features": {},
"compositeIdSpec": {
"routeKey1Field": "<string>",
"routeKey1Bits": 123,
"routeKey2Field": "<string>",
"routeKey2Bits": 123
},
"solrParams": {
"name": "<string>",
"numShards": 123,
"replicationFactor": 123,
"collection.configName": "<string>"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"relatedCollectionId": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.put("https://{FUSION_HOST}:8764/api/apollo/collections/{collection}")
.header("Content-Type", "application/json")
.body("{\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"searchClusterId\": \"<string>\",\n \"commitWithin\": 123,\n \"features\": {},\n \"compositeIdSpec\": {\n \"routeKey1Field\": \"<string>\",\n \"routeKey1Bits\": 123,\n \"routeKey2Field\": \"<string>\",\n \"routeKey2Bits\": 123\n },\n \"solrParams\": {\n \"name\": \"<string>\",\n \"numShards\": 123,\n \"replicationFactor\": 123,\n \"collection.configName\": \"<string>\"\n },\n \"modifiedAt\": \"2023-11-07T05:31:56Z\",\n \"relatedCollectionId\": \"<string>\",\n \"metadata\": {}\n}")
.asString();const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
createdAt: '2023-11-07T05:31:56Z',
searchClusterId: '<string>',
commitWithin: 123,
features: {},
compositeIdSpec: {
routeKey1Field: '<string>',
routeKey1Bits: 123,
routeKey2Field: '<string>',
routeKey2Bits: 123
},
solrParams: {
name: '<string>',
numShards: 123,
replicationFactor: 123,
'collection.configName': '<string>'
},
modifiedAt: '2023-11-07T05:31:56Z',
relatedCollectionId: '<string>',
metadata: {}
})
};
fetch('https://{FUSION_HOST}:8764/api/apollo/collections/{collection}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}:8764/api/apollo/collections/{collection}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"searchClusterId\": \"<string>\",\n \"commitWithin\": 123,\n \"features\": {},\n \"compositeIdSpec\": {\n \"routeKey1Field\": \"<string>\",\n \"routeKey1Bits\": 123,\n \"routeKey2Field\": \"<string>\",\n \"routeKey2Bits\": 123\n },\n \"solrParams\": {\n \"name\": \"<string>\",\n \"numShards\": 123,\n \"replicationFactor\": 123,\n \"collection.configName\": \"<string>\"\n },\n \"modifiedAt\": \"2023-11-07T05:31:56Z\",\n \"relatedCollectionId\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}:8764/api/apollo/collections/{collection}"
payload := strings.NewReader("{\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"searchClusterId\": \"<string>\",\n \"commitWithin\": 123,\n \"features\": {},\n \"compositeIdSpec\": {\n \"routeKey1Field\": \"<string>\",\n \"routeKey1Bits\": 123,\n \"routeKey2Field\": \"<string>\",\n \"routeKey2Bits\": 123\n },\n \"solrParams\": {\n \"name\": \"<string>\",\n \"numShards\": 123,\n \"replicationFactor\": 123,\n \"collection.configName\": \"<string>\"\n },\n \"modifiedAt\": \"2023-11-07T05:31:56Z\",\n \"relatedCollectionId\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8764",
CURLOPT_URL => "https://{FUSION_HOST}:8764/api/apollo/collections/{collection}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'createdAt' => '2023-11-07T05:31:56Z',
'searchClusterId' => '<string>',
'commitWithin' => 123,
'features' => [
],
'compositeIdSpec' => [
'routeKey1Field' => '<string>',
'routeKey1Bits' => 123,
'routeKey2Field' => '<string>',
'routeKey2Bits' => 123
],
'solrParams' => [
'name' => '<string>',
'numShards' => 123,
'replicationFactor' => 123,
'collection.configName' => '<string>'
],
'modifiedAt' => '2023-11-07T05:31:56Z',
'relatedCollectionId' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://{FUSION_HOST}:8764/api/apollo/collections/{collection} \
--header 'Content-Type: application/json' \
--data '
{
"createdAt": "2023-11-07T05:31:56Z",
"searchClusterId": "<string>",
"commitWithin": 123,
"features": {},
"compositeIdSpec": {
"routeKey1Field": "<string>",
"routeKey1Bits": 123,
"routeKey2Field": "<string>",
"routeKey2Bits": 123
},
"solrParams": {
"name": "<string>",
"numShards": 123,
"replicationFactor": 123,
"collection.configName": "<string>"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"relatedCollectionId": "<string>",
"metadata": {}
}
'{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"searchClusterId": "<string>",
"commitWithin": 123,
"features": {},
"compositeIdSpec": {
"routeKey1Field": "<string>",
"routeKey1Bits": 123,
"routeKey2Field": "<string>",
"routeKey2Bits": 123
},
"solrParams": {
"name": "<string>",
"numShards": 123,
"replicationFactor": 123,
"collection.configName": "<string>"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"type": "DATA",
"relatedCollectionId": "<string>",
"metadata": {}
}Create a new data collection or update an existing one
PUT
/
collections
/
{collection}
Create a new data collection or update an existing one
import requests
url = "https://{FUSION_HOST}:8764/api/apollo/collections/{collection}"
payload = {
"createdAt": "2023-11-07T05:31:56Z",
"searchClusterId": "<string>",
"commitWithin": 123,
"features": {},
"compositeIdSpec": {
"routeKey1Field": "<string>",
"routeKey1Bits": 123,
"routeKey2Field": "<string>",
"routeKey2Bits": 123
},
"solrParams": {
"name": "<string>",
"numShards": 123,
"replicationFactor": 123,
"collection.configName": "<string>"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"relatedCollectionId": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.put("https://{FUSION_HOST}:8764/api/apollo/collections/{collection}")
.header("Content-Type", "application/json")
.body("{\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"searchClusterId\": \"<string>\",\n \"commitWithin\": 123,\n \"features\": {},\n \"compositeIdSpec\": {\n \"routeKey1Field\": \"<string>\",\n \"routeKey1Bits\": 123,\n \"routeKey2Field\": \"<string>\",\n \"routeKey2Bits\": 123\n },\n \"solrParams\": {\n \"name\": \"<string>\",\n \"numShards\": 123,\n \"replicationFactor\": 123,\n \"collection.configName\": \"<string>\"\n },\n \"modifiedAt\": \"2023-11-07T05:31:56Z\",\n \"relatedCollectionId\": \"<string>\",\n \"metadata\": {}\n}")
.asString();const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
createdAt: '2023-11-07T05:31:56Z',
searchClusterId: '<string>',
commitWithin: 123,
features: {},
compositeIdSpec: {
routeKey1Field: '<string>',
routeKey1Bits: 123,
routeKey2Field: '<string>',
routeKey2Bits: 123
},
solrParams: {
name: '<string>',
numShards: 123,
replicationFactor: 123,
'collection.configName': '<string>'
},
modifiedAt: '2023-11-07T05:31:56Z',
relatedCollectionId: '<string>',
metadata: {}
})
};
fetch('https://{FUSION_HOST}:8764/api/apollo/collections/{collection}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://{FUSION_HOST}:8764/api/apollo/collections/{collection}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"searchClusterId\": \"<string>\",\n \"commitWithin\": 123,\n \"features\": {},\n \"compositeIdSpec\": {\n \"routeKey1Field\": \"<string>\",\n \"routeKey1Bits\": 123,\n \"routeKey2Field\": \"<string>\",\n \"routeKey2Bits\": 123\n },\n \"solrParams\": {\n \"name\": \"<string>\",\n \"numShards\": 123,\n \"replicationFactor\": 123,\n \"collection.configName\": \"<string>\"\n },\n \"modifiedAt\": \"2023-11-07T05:31:56Z\",\n \"relatedCollectionId\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{FUSION_HOST}:8764/api/apollo/collections/{collection}"
payload := strings.NewReader("{\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"searchClusterId\": \"<string>\",\n \"commitWithin\": 123,\n \"features\": {},\n \"compositeIdSpec\": {\n \"routeKey1Field\": \"<string>\",\n \"routeKey1Bits\": 123,\n \"routeKey2Field\": \"<string>\",\n \"routeKey2Bits\": 123\n },\n \"solrParams\": {\n \"name\": \"<string>\",\n \"numShards\": 123,\n \"replicationFactor\": 123,\n \"collection.configName\": \"<string>\"\n },\n \"modifiedAt\": \"2023-11-07T05:31:56Z\",\n \"relatedCollectionId\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8764",
CURLOPT_URL => "https://{FUSION_HOST}:8764/api/apollo/collections/{collection}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'createdAt' => '2023-11-07T05:31:56Z',
'searchClusterId' => '<string>',
'commitWithin' => 123,
'features' => [
],
'compositeIdSpec' => [
'routeKey1Field' => '<string>',
'routeKey1Bits' => 123,
'routeKey2Field' => '<string>',
'routeKey2Bits' => 123
],
'solrParams' => [
'name' => '<string>',
'numShards' => 123,
'replicationFactor' => 123,
'collection.configName' => '<string>'
],
'modifiedAt' => '2023-11-07T05:31:56Z',
'relatedCollectionId' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}curl --request PUT \
--url https://{FUSION_HOST}:8764/api/apollo/collections/{collection} \
--header 'Content-Type: application/json' \
--data '
{
"createdAt": "2023-11-07T05:31:56Z",
"searchClusterId": "<string>",
"commitWithin": 123,
"features": {},
"compositeIdSpec": {
"routeKey1Field": "<string>",
"routeKey1Bits": 123,
"routeKey2Field": "<string>",
"routeKey2Bits": 123
},
"solrParams": {
"name": "<string>",
"numShards": 123,
"replicationFactor": 123,
"collection.configName": "<string>"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"relatedCollectionId": "<string>",
"metadata": {}
}
'{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"searchClusterId": "<string>",
"commitWithin": 123,
"features": {},
"compositeIdSpec": {
"routeKey1Field": "<string>",
"routeKey1Bits": 123,
"routeKey2Field": "<string>",
"routeKey2Bits": 123
},
"solrParams": {
"name": "<string>",
"numShards": 123,
"replicationFactor": 123,
"collection.configName": "<string>"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"type": "DATA",
"relatedCollectionId": "<string>",
"metadata": {}
}Body
application/json
JSON-formatted configuration values
Response
200 - application/json
successful operation
Was this page helpful?