Commit df843b52 authored by Philip Schildkamp's avatar Philip Schildkamp

Implement ElasticSearch Index NodeType

parent 1de67627
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-ElasticsearchIndex-IA-Configure_1.7.6-w1-wip1">
<ArtifactTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="ElasticsearchIndex-IA-Configure_1.7.6-w1-wip1" type="ToscaBaseTypes:ScriptArtifact" id="ElasticsearchIndex-IA-Configure_1.7.6-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/ElasticsearchIndex-IA-Configure_1.7.6-w1-wip1/files/configure.sh"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
#!/bin/bash
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=elasticsearch_index
CONFIGURE_VERSION=1.7.6
# ----------------------------------------------------------------------------
CONFIGURE_APIHOST=http://127.0.0.1:$APIPort
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE#*.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_APIHOST/$IndexName/_mapping \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
# flow
fn_pkginfo && fn_configure \
|| echo "ERROR=CONFIGURE:$CONFIGURE_PACKAGE"
#!/bin/bash
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=elasticsearch_index
CONFIGURE_VERSION=1.7.6
# ----------------------------------------------------------------------------
CONFIGURE_APIHOST=http://127.0.0.1:$APIPort
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE#*.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_APIHOST/$IndexName/_mapping \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
# flow
fn_pkginfo && fn_configure \
|| echo "ERROR=CONFIGURE:$CONFIGURE_PACKAGE"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-ElasticsearchIndex-IA-Configure_7.1.1-w1-wip1">
<ArtifactTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="ElasticsearchIndex-IA-Configure_7.1.1-w1-wip1" type="ToscaBaseTypes:ScriptArtifact" id="ElasticsearchIndex-IA-Configure_7.1.1-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/ElasticsearchIndex-IA-Configure_7.1.1-w1-wip1/files/configure.sh"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
#!/bin/bash
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=elasticsearch_index
CONFIGURE_VERSION=7.1.1
# ----------------------------------------------------------------------------
CONFIGURE_APIHOST=http://127.0.0.1:$APIPort
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE#*.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_APIHOST/$IndexName/_mapping \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
# flow
fn_pkginfo && fn_configure \
|| echo "ERROR=CONFIGURE:$CONFIGURE_PACKAGE"
#!/bin/bash
# pkginfo
fn_pkginfo() {
CONFIGURE_PACKAGE=elasticsearch_index
CONFIGURE_VERSION=7.1.1
# ----------------------------------------------------------------------------
CONFIGURE_APIHOST=http://127.0.0.1:$APIPort
CONFIGURE_CSARDIR=$(find ~ -maxdepth 1 -path "*.csar")
}
# configure
fn_configure() {
while read -rd ';' TUPLE; do FILE="${TUPLE#*,}"
test "${FILE#*.json}" == "$FILE" && continue
curl -sX POST $CONFIGURE_APIHOST/$IndexName/_mapping \
-H "Content-Type: application/json" \
-T "$CONFIGURE_CSARDIR/$FILE"
done <<< "$DAs"
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
# flow
fn_pkginfo && fn_configure \
|| echo "ERROR=CONFIGURE:$CONFIGURE_PACKAGE"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-ElasticsearchIndex-IA-Install_1.7.6-w1-wip1">
<ArtifactTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="ElasticsearchIndex-IA-Install_1.7.6-w1-wip1" type="ToscaBaseTypes:ScriptArtifact" id="ElasticsearchIndex-IA-Install_1.7.6-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/ElasticsearchIndex-IA-Install_1.7.6-w1-wip1/files/install.sh"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
#!/bin/bash
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=elasticsearch_index
INSTALL_VERSION=1.7.6
# ----------------------------------------------------------------------------
INSTALL_APIHOST=http://127.0.0.1:$APIPort
INSTALL_WARRANT="\"number\" : \"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_APIHOST)" || return 1
curl -sX PUT $INSTALL_APIHOST/$IndexName
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
#!/bin/bash
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=elasticsearch_index
INSTALL_VERSION=1.7.6
# ----------------------------------------------------------------------------
INSTALL_APIHOST=http://127.0.0.1:$APIPort
INSTALL_WARRANT="\"number\" : \"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_APIHOST)" || return 1
curl -sX PUT $INSTALL_APIHOST/$IndexName
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-ElasticsearchIndex-IA-Install_7.1.1-w1-wip1">
<ArtifactTemplate xmlns:ToscaBaseTypes="http://docs.oasis-open.org/tosca/ns/2011/12/ToscaBaseTypes" name="ElasticsearchIndex-IA-Install_7.1.1-w1-wip1" type="ToscaBaseTypes:ScriptArtifact" id="ElasticsearchIndex-IA-Install_7.1.1-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/ElasticsearchIndex-IA-Install_7.1.1-w1-wip1/files/install.sh"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
#!/bin/bash
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=elasticsearch_index
INSTALL_VERSION=7.1.1
# ----------------------------------------------------------------------------
INSTALL_APIHOST=http://127.0.0.1:$APIPort
INSTALL_WARRANT="\"number\" : \"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_APIHOST)" || return 1
curl -sX PUT $INSTALL_APIHOST/$IndexName
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
#!/bin/bash
# pkginfo
fn_pkginfo() {
INSTALL_PACKAGE=elasticsearch_index
INSTALL_VERSION=7.1.1
# ----------------------------------------------------------------------------
INSTALL_APIHOST=http://127.0.0.1:$APIPort
INSTALL_WARRANT="\"number\" : \"$INSTALL_VERSION\""
}
# install
fn_install() {
which curl || sudo apt-get -qy install curl
grep -q "$INSTALL_WARRANT" <<< "$(curl -s $INSTALL_APIHOST)" || return 1
curl -sX PUT $INSTALL_APIHOST/$IndexName
}
# env
export DEBIAN_FRONTEND=noninteractive
source /etc/lsb-release
sudo apt-get -qy update
# flow
fn_pkginfo && fn_install \
|| echo "ERROR=INSTALL:$INSTALL_PACKAGE"
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Definitions xmlns="http://docs.oasis-open.org/tosca/ns/2011/12" xmlns:winery="http://www.opentosca.org/winery/extensions/tosca/2013/02/12" xmlns:selfservice="http://www.eclipse.org/winery/model/selfservice" xmlns:testwineryopentoscaorg="http://test.winery.opentosca.org" targetNamespace="http://dch.uni-koeln.de/tosca/artifacttemplates" id="winery-defs-for_dch_artifacttemplates-MusicalCompetitionsDatabase-DA-Elasticsearch_0.0.1-w1-wip1">
<ArtifactTemplate xmlns:dch_artifacttypes="http://dch.uni-koeln.de/tosca/artifacttypes" name="MusicalCompetitionsDatabase-DA-Elasticsearch_0.0.1-w1-wip1" type="dch_artifacttypes:DataArtifact" id="MusicalCompetitionsDatabase-DA-Elasticsearch_0.0.1-w1-wip1">
<ArtifactReferences>
<ArtifactReference reference="artifacttemplates/http%253A%252F%252Fdch.uni-koeln.de%252Ftosca%252Fartifacttemplates/MusicalCompetitionsDatabase-DA-Elasticsearch_0.0.1-w1-wip1/files/mcd-mapping-2019-07-01.json"/>
</ArtifactReferences>
</ArtifactTemplate>
</Definitions>
{
"contest" : {
"properties" : {
"_rev" : {
"type" : "string"
},
"anlass" : {
"type" : "string"
},
"aufgaben" : {
"type" : "nested",
"properties" : {
"aufgabentyp" : {
"type" : "string",
"index": "analyzed",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"spezifizierung" : {
"type" : "string"
},
"systematik" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"wettbewerbskontext" : {
"type" : "string"
}
}
},
"auszeichnungen" : {
"type" : "nested",
"properties" : {
"auszeichnungsarten" : {
"type" : "string"
},
"platzierungen" : {
"type" : "nested",
"properties" : {
"beschreibung" : {
"type" : "string"
},
"platzierte" : {
"type" : "string"
},
"rang" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
}
}
},
"wettbewerbskontext" : {
"type" : "string"
}
}
},
"beteiligte" : {
"type" : "nested",
"properties" : {
"anmerkung" : {
"type" : "string"
},
"identifier" : {
"type" : "string"
},
"kollaboration" : {
"type" : "string"
},
"name" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"rolle" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"wettbewerbskontext" : {
"type" : "string"
}
}
},
"bezeichnung" : {
"type" : "string"
},
"ereignisse" : {
"type" : "nested",
"properties" : {
"ausgefallen" : {
"type" : "boolean"
},
"beschreibung" : {
"type" : "string"
},
"ereignistyp" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"ort" : {
"properties" : {
"altName" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"esCountry" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"esGeoPoint" : {
"type" : "geo_point"
},
"esGeonameId" : {
"type" : "long"
},
"ortsname" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"ortszusatz" : {
"type" : "string"
}
}
},
"wettbewerbskontext" : {
"type" : "string"
},
"zeit" : {
"properties" : {
"bis" : {
"type" : "string"
},
"datum" : {
"type" : "string"
},
"datumszusatz" : {
"type" : "string"
},
"esDateRange" : {
"properties" : {
"end" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"start" : {
"type" : "date",
"format" : "dateOptionalTime"
}
}
},
"von" : {
"type" : "string"
}
}
}
}
},
"ergaenzungen" : {
"type" : "string"
},
"esEnd" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"esGeoP" : {
"type" : "geo_point"
},
"esPlacename" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"esStart" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"formalia" : {
"type" : "string"
},
"kommentare" : {
"properties" : {
"text" : {
"type" : "string"
},
"thema" : {
"type" : "string"
}
}
},
"notizen" : {
"properties" : {
"autorIn" : {
"type" : "string"
},
"datumLast" : {
"type" : "string"
},
"text" : {
"type" : "string"
}
}
},
"quellen" : {
"properties" : {
"korpus" : {
"type" : "boolean"
},
"quellenangabe" : {
"type" : "string"
}
}
},
"reduzierteErfassung" : {
"type" : "boolean"
},
"schlagwoerter" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},
"serienzuordnung" : {
"properties" : {
"serienBezeichnung" : {
"type" : "string",
"fields": {
"raw": {"type": "string", "index": "not_analyzed"}
}
},