Configuration Element Edition - ABO

Back Office Integration Guide

Product
ABO
AFS_Version
7.9
Category
Reference Guide
language
English

This API allows to edit one element of a Configuration. For more information, see Configuration Application chapter of the AFS Back Office User Guide.

A "Configuration upload" API request takes the following form:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"value\":{"afs:t":"$VALUE_TYPE","value":$VALUE}}" "http://$HOST/bo-ws/service/$SERVICE_ID/instance/$SERVICE_STATUS/configuration/$CONFIGURATION_NAME/item/$ENCODED_ITEM_PATH?afs:login=login://$USER:$PASSWORD@$AUTHENTICATION_AUTHORITY"

The list of parameters and their possible values are enumerated below.

  • $VALUE_TYPE is the type of the value you want to change. The possible value types are ListString, MapStringString, ScalarBool, ScalarDouble, ScalarString, ScalarUInt.
  • $VALUE is the value to be changed.
  • $HOST is the server hosting the Back Office.
  • $SERVICE_ID is the ID of the desired service.
  • $SERVICE_STATUS is the status of the desired service.
  • $CONFIGURATION_NAME is the name of the configuration (Front for the Query Engine, or the name of the PaF).
  • $ENCODED_ITEM_PATH is the path of the configuration item (the XPath in the XML file) encoded. For example, the path Qeng/SearchFrontEnd/maxMemoryMb should be encoded as QEng%2FSearchFrontEnd%2FmaxMemoryMb

The layout of the request depends on the $VALUE_TYPE of the option. The list of configuration elements is available in AFS Configuration Guide, appendix List of AFS Configuration Options. In AFS, the type of the option is identified differently. Find hereafter the corresponding AFS option type for each BO API $VALUE_TYPE, and its associated request.

BO API value_type

AFS Options type


Layout of the request

ListString

string_list

{"value":{"afs:t":"ListString","values":{"x:values":{"my value 1","my value 2"}}}}

MapStringString

string_map

{"value":{"afs:t":"MapStringString","values":{"x:values":[{"afs:t":"MapStringStringItem","key":"my key 1","value":"my value 1"},{"afs:t":"MapStringStringItem","key":"my key 1","value":"my value 1"}]}}}

ScalarBool

bool

{"value":{"afs:t":"ScalarBool","value":true}}

ScalarDouble

double

{"value":{"afs:t":"ScalarDouble","value":0.5}}

ScalarString

string

{"value":{"afs:t":"ScalarString","value":"my value"}}

ScalarUInt

uint

{"value":{"afs:t":"ScalarUInt","value":7010}}

Find hereafter a request example for each type:

  • ListString:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"value\":{\"afs:t\":\"ListString\",\"values\":{\"x:values\":{\"my value 1\",\"my value 2\"}}}}" "http://10.61.8.175/bo-ws/service/1/instance/stable/configuration/Front/item/QEng%2FSearchFrontEnd%2FQueryParsing%2FemptyWords?afs:login=login://<user>:<password>@<authentication_authority>"

  • MapStringString:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"value\":{\"afs:t\":\"MapStringString\",\"values\":{\"x:values\":[{\"afs:t\":\"MapStringStringItem\",\"key\":\"my key 1\",\"value\":\"my value 1\"},{\"afs:t\":\"MapStringStringItem\",\"key\":\"my key 1\",\"value\":\"my value 1\"}]}}}" "http://10.61.8.175/bo-ws/service/1/instance/stable/configuration/Front/item/QEng%2FSearchFrontEnd%2FQueryParsing%2FdefaultParameter?afs:login=login://<user>:<password>@<authentication_authority>"

  • ScalarBool:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"value\":{\"afs:t\":\"ScalarBool\",\"value\":true}}" "http://10.61.8.175/bo-ws/service/1/instance/stable/configuration/Front/item/QEng%2FSearchFrontEnd%2FQueryParsing%2FcaseSensitiveEmptyWords?afs:login=login://<user>:<password>@<authentication_authority>"

  • ScalarDouble:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"value\":{\"afs:t\":\"ScalarDouble\",\"value\":0.5}}" "http://10.61.8.175/bo-ws/service/1/instance/stable/configuration/Front/item/QEng%2FACP%2FServer%2FFuzzy%2Falpha?afs:login=login://<user>:<password>@<authentication_authority>"

  • ScalarString:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"value\":{\"afs:t\":\"ScalarString\",\"value\":\"my value\"}}" "http://10.61.8.175/bo-ws/service/1/instance/stable/configuration/Front/item/QEng%2FSearchFrontEnd%2FQueryParsing%2FremoveCharacters?afs:login=login://<user>:<password>@<authentication_authority>"

  • ScalarUInt:

curl -H Expect: -H "Content-Type:application/json" --request PUT --data "{\"value\":{\"afs:t\":\"ScalarUInt\",\"value\":7010}}" "http://10.61.8.175/bo-ws/service/1/instance/stable/configuration/Front/item/QEng%2FSearchFrontEnd%2FmaxMemoryMb?afs:login=login://<user>:<password>@<authentication_authority>"

Once one element of the Configuration has been edited, it is necessary to publish this Configuration. See Configuration Upload and Publish.