(deprecated since 23.1)Update Materialized view
curl --request PUT \
--url http://10.2.4.166:8080/composer/api/materialized-views/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/vnd.composer.v3+json' \
--data '
{
"name": "<string>",
"description": "<string>",
"enabled": true,
"definition": {
"filters": [
{
"path": {
"name": "<string>"
},
"value": "<unknown>"
}
],
"sourceId": "<string>",
"aggregations": [
{
"field": {
"name": "<string>"
}
}
],
"metrics": [
{
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
}
]
},
"storageSettings": {
"targetStorage": {
"connectionId": "<string>",
"schemas": [
"<string>"
],
"collection": "<string>",
"collectionParams": {}
},
"fieldMappings": [
{
"targetFieldName": "<string>",
"sourceFieldName": "<string>",
"sourceMetric": {
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
},
"sourceAggregation": {
"field": {
"name": "<string>"
}
}
}
]
}
}
'import requests
url = "http://10.2.4.166:8080/composer/api/materialized-views/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"enabled": True,
"definition": {
"filters": [
{
"path": { "name": "<string>" },
"value": "<unknown>"
}
],
"sourceId": "<string>",
"aggregations": [{ "field": { "name": "<string>" } }],
"metrics": [
{
"rollup": True,
"formulaName": "<string>",
"formula": "<string>"
}
]
},
"storageSettings": {
"targetStorage": {
"connectionId": "<string>",
"schemas": ["<string>"],
"collection": "<string>",
"collectionParams": {}
},
"fieldMappings": [
{
"targetFieldName": "<string>",
"sourceFieldName": "<string>",
"sourceMetric": {
"rollup": True,
"formulaName": "<string>",
"formula": "<string>"
},
"sourceAggregation": { "field": { "name": "<string>" } }
}
]
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/vnd.composer.v3+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/vnd.composer.v3+json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
enabled: true,
definition: {
filters: [{path: {name: '<string>'}, value: '<unknown>'}],
sourceId: '<string>',
aggregations: [{field: {name: '<string>'}}],
metrics: [{rollup: true, formulaName: '<string>', formula: '<string>'}]
},
storageSettings: {
targetStorage: {
connectionId: '<string>',
schemas: ['<string>'],
collection: '<string>',
collectionParams: {}
},
fieldMappings: [
{
targetFieldName: '<string>',
sourceFieldName: '<string>',
sourceMetric: {rollup: true, formulaName: '<string>', formula: '<string>'},
sourceAggregation: {field: {name: '<string>'}}
}
]
}
})
};
fetch('http://10.2.4.166:8080/composer/api/materialized-views/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/materialized-views/{id}",
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([
'name' => '<string>',
'description' => '<string>',
'enabled' => true,
'definition' => [
'filters' => [
[
'path' => [
'name' => '<string>'
],
'value' => '<unknown>'
]
],
'sourceId' => '<string>',
'aggregations' => [
[
'field' => [
'name' => '<string>'
]
]
],
'metrics' => [
[
'rollup' => true,
'formulaName' => '<string>',
'formula' => '<string>'
]
]
],
'storageSettings' => [
'targetStorage' => [
'connectionId' => '<string>',
'schemas' => [
'<string>'
],
'collection' => '<string>',
'collectionParams' => [
]
],
'fieldMappings' => [
[
'targetFieldName' => '<string>',
'sourceFieldName' => '<string>',
'sourceMetric' => [
'rollup' => true,
'formulaName' => '<string>',
'formula' => '<string>'
],
'sourceAggregation' => [
'field' => [
'name' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/vnd.composer.v3+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://10.2.4.166:8080/composer/api/materialized-views/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"definition\": {\n \"filters\": [\n {\n \"path\": {\n \"name\": \"<string>\"\n },\n \"value\": \"<unknown>\"\n }\n ],\n \"sourceId\": \"<string>\",\n \"aggregations\": [\n {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n ],\n \"metrics\": [\n {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n }\n ]\n },\n \"storageSettings\": {\n \"targetStorage\": {\n \"connectionId\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"collectionParams\": {}\n },\n \"fieldMappings\": [\n {\n \"targetFieldName\": \"<string>\",\n \"sourceFieldName\": \"<string>\",\n \"sourceMetric\": {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n },\n \"sourceAggregation\": {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/vnd.composer.v3+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://10.2.4.166:8080/composer/api/materialized-views/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/vnd.composer.v3+json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"definition\": {\n \"filters\": [\n {\n \"path\": {\n \"name\": \"<string>\"\n },\n \"value\": \"<unknown>\"\n }\n ],\n \"sourceId\": \"<string>\",\n \"aggregations\": [\n {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n ],\n \"metrics\": [\n {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n }\n ]\n },\n \"storageSettings\": {\n \"targetStorage\": {\n \"connectionId\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"collectionParams\": {}\n },\n \"fieldMappings\": [\n {\n \"targetFieldName\": \"<string>\",\n \"sourceFieldName\": \"<string>\",\n \"sourceMetric\": {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n },\n \"sourceAggregation\": {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/materialized-views/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/vnd.composer.v3+json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"definition\": {\n \"filters\": [\n {\n \"path\": {\n \"name\": \"<string>\"\n },\n \"value\": \"<unknown>\"\n }\n ],\n \"sourceId\": \"<string>\",\n \"aggregations\": [\n {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n ],\n \"metrics\": [\n {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n }\n ]\n },\n \"storageSettings\": {\n \"targetStorage\": {\n \"connectionId\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"collectionParams\": {}\n },\n \"fieldMappings\": [\n {\n \"targetFieldName\": \"<string>\",\n \"sourceFieldName\": \"<string>\",\n \"sourceMetric\": {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n },\n \"sourceAggregation\": {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"description": "<string>",
"enabled": true,
"definition": {
"type": "AGG",
"filters": [
{
"path": {
"name": "<string>"
},
"operation": "EQUALS",
"value": "<unknown>"
}
],
"sourceId": "<string>",
"aggregations": [
{
"type": "TERMS",
"field": {
"name": "<string>"
}
}
],
"metrics": [
{
"type": "COUNT",
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
}
]
},
"storageSettings": {
"targetStorage": {
"connectionId": "<string>",
"schemas": [
"<string>"
],
"collection": "<string>",
"collectionParams": {}
},
"fieldMappings": [
{
"targetFieldName": "<string>",
"sourceFieldName": "<string>",
"sourceMetric": {
"type": "COUNT",
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
},
"sourceAggregation": {
"type": "TERMS",
"field": {
"name": "<string>"
}
}
}
]
},
"id": "<string>",
"referencedSourceIds": [
"<string>"
],
"definitionQuery": "<string>"
}(deprecated since 23.1)Update Materialized view
deprecated
(deprecated since 23.1)Update Materialized view
curl --request PUT \
--url http://10.2.4.166:8080/composer/api/materialized-views/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/vnd.composer.v3+json' \
--data '
{
"name": "<string>",
"description": "<string>",
"enabled": true,
"definition": {
"filters": [
{
"path": {
"name": "<string>"
},
"value": "<unknown>"
}
],
"sourceId": "<string>",
"aggregations": [
{
"field": {
"name": "<string>"
}
}
],
"metrics": [
{
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
}
]
},
"storageSettings": {
"targetStorage": {
"connectionId": "<string>",
"schemas": [
"<string>"
],
"collection": "<string>",
"collectionParams": {}
},
"fieldMappings": [
{
"targetFieldName": "<string>",
"sourceFieldName": "<string>",
"sourceMetric": {
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
},
"sourceAggregation": {
"field": {
"name": "<string>"
}
}
}
]
}
}
'import requests
url = "http://10.2.4.166:8080/composer/api/materialized-views/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"enabled": True,
"definition": {
"filters": [
{
"path": { "name": "<string>" },
"value": "<unknown>"
}
],
"sourceId": "<string>",
"aggregations": [{ "field": { "name": "<string>" } }],
"metrics": [
{
"rollup": True,
"formulaName": "<string>",
"formula": "<string>"
}
]
},
"storageSettings": {
"targetStorage": {
"connectionId": "<string>",
"schemas": ["<string>"],
"collection": "<string>",
"collectionParams": {}
},
"fieldMappings": [
{
"targetFieldName": "<string>",
"sourceFieldName": "<string>",
"sourceMetric": {
"rollup": True,
"formulaName": "<string>",
"formula": "<string>"
},
"sourceAggregation": { "field": { "name": "<string>" } }
}
]
}
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/vnd.composer.v3+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
Authorization: 'Basic <encoded-value>',
'Content-Type': 'application/vnd.composer.v3+json'
},
body: JSON.stringify({
name: '<string>',
description: '<string>',
enabled: true,
definition: {
filters: [{path: {name: '<string>'}, value: '<unknown>'}],
sourceId: '<string>',
aggregations: [{field: {name: '<string>'}}],
metrics: [{rollup: true, formulaName: '<string>', formula: '<string>'}]
},
storageSettings: {
targetStorage: {
connectionId: '<string>',
schemas: ['<string>'],
collection: '<string>',
collectionParams: {}
},
fieldMappings: [
{
targetFieldName: '<string>',
sourceFieldName: '<string>',
sourceMetric: {rollup: true, formulaName: '<string>', formula: '<string>'},
sourceAggregation: {field: {name: '<string>'}}
}
]
}
})
};
fetch('http://10.2.4.166:8080/composer/api/materialized-views/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://10.2.4.166:8080/composer/api/materialized-views/{id}",
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([
'name' => '<string>',
'description' => '<string>',
'enabled' => true,
'definition' => [
'filters' => [
[
'path' => [
'name' => '<string>'
],
'value' => '<unknown>'
]
],
'sourceId' => '<string>',
'aggregations' => [
[
'field' => [
'name' => '<string>'
]
]
],
'metrics' => [
[
'rollup' => true,
'formulaName' => '<string>',
'formula' => '<string>'
]
]
],
'storageSettings' => [
'targetStorage' => [
'connectionId' => '<string>',
'schemas' => [
'<string>'
],
'collection' => '<string>',
'collectionParams' => [
]
],
'fieldMappings' => [
[
'targetFieldName' => '<string>',
'sourceFieldName' => '<string>',
'sourceMetric' => [
'rollup' => true,
'formulaName' => '<string>',
'formula' => '<string>'
],
'sourceAggregation' => [
'field' => [
'name' => '<string>'
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/vnd.composer.v3+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://10.2.4.166:8080/composer/api/materialized-views/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"definition\": {\n \"filters\": [\n {\n \"path\": {\n \"name\": \"<string>\"\n },\n \"value\": \"<unknown>\"\n }\n ],\n \"sourceId\": \"<string>\",\n \"aggregations\": [\n {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n ],\n \"metrics\": [\n {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n }\n ]\n },\n \"storageSettings\": {\n \"targetStorage\": {\n \"connectionId\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"collectionParams\": {}\n },\n \"fieldMappings\": [\n {\n \"targetFieldName\": \"<string>\",\n \"sourceFieldName\": \"<string>\",\n \"sourceMetric\": {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n },\n \"sourceAggregation\": {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n }\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/vnd.composer.v3+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://10.2.4.166:8080/composer/api/materialized-views/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/vnd.composer.v3+json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"definition\": {\n \"filters\": [\n {\n \"path\": {\n \"name\": \"<string>\"\n },\n \"value\": \"<unknown>\"\n }\n ],\n \"sourceId\": \"<string>\",\n \"aggregations\": [\n {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n ],\n \"metrics\": [\n {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n }\n ]\n },\n \"storageSettings\": {\n \"targetStorage\": {\n \"connectionId\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"collectionParams\": {}\n },\n \"fieldMappings\": [\n {\n \"targetFieldName\": \"<string>\",\n \"sourceFieldName\": \"<string>\",\n \"sourceMetric\": {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n },\n \"sourceAggregation\": {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://10.2.4.166:8080/composer/api/materialized-views/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/vnd.composer.v3+json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"enabled\": true,\n \"definition\": {\n \"filters\": [\n {\n \"path\": {\n \"name\": \"<string>\"\n },\n \"value\": \"<unknown>\"\n }\n ],\n \"sourceId\": \"<string>\",\n \"aggregations\": [\n {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n ],\n \"metrics\": [\n {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n }\n ]\n },\n \"storageSettings\": {\n \"targetStorage\": {\n \"connectionId\": \"<string>\",\n \"schemas\": [\n \"<string>\"\n ],\n \"collection\": \"<string>\",\n \"collectionParams\": {}\n },\n \"fieldMappings\": [\n {\n \"targetFieldName\": \"<string>\",\n \"sourceFieldName\": \"<string>\",\n \"sourceMetric\": {\n \"rollup\": true,\n \"formulaName\": \"<string>\",\n \"formula\": \"<string>\"\n },\n \"sourceAggregation\": {\n \"field\": {\n \"name\": \"<string>\"\n }\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"description": "<string>",
"enabled": true,
"definition": {
"type": "AGG",
"filters": [
{
"path": {
"name": "<string>"
},
"operation": "EQUALS",
"value": "<unknown>"
}
],
"sourceId": "<string>",
"aggregations": [
{
"type": "TERMS",
"field": {
"name": "<string>"
}
}
],
"metrics": [
{
"type": "COUNT",
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
}
]
},
"storageSettings": {
"targetStorage": {
"connectionId": "<string>",
"schemas": [
"<string>"
],
"collection": "<string>",
"collectionParams": {}
},
"fieldMappings": [
{
"targetFieldName": "<string>",
"sourceFieldName": "<string>",
"sourceMetric": {
"type": "COUNT",
"rollup": true,
"formulaName": "<string>",
"formula": "<string>"
},
"sourceAggregation": {
"type": "TERMS",
"field": {
"name": "<string>"
}
}
}
]
},
"id": "<string>",
"referencedSourceIds": [
"<string>"
],
"definitionQuery": "<string>"
}Authorizations
HTTP Basic authentication using global administrator credentials (username and password).
Path Parameters
Body
application/vnd.composer.v3+json
Materialized view input.
Structure that defines the data stored in a Materialized View.
- Option 1
- Option 2
Show child attributes
Show child attributes
Storage settings for Materialized View, required to use external data storage. If not specified, data will be automatically stored internally.
Show child attributes
Show child attributes
Response
200 - application/vnd.composer.v3+json
OK
Materialized View
Structure that defines the data stored in a Materialized View.
- Option 1
- Option 2
Show child attributes
Show child attributes
Storage settings for Materialized View, required to use external data storage. If not specified, data will be automatically stored internally.
Show child attributes
Show child attributes
Sources that can be matched by this Materialized View.
SQL query that defines this Materialized View.
Was this page helpful?