Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
POST https://VFC_MR_DOMAIN/verba/restapi/v1/servers/verbamr02/configurationTasks

Use case: Configure a fresh VFC server based on an existing other server’s configuration

In cloud based solutions to decrease a server load a possible solution is to start a new serve with the same role to balance the load during the peak times. This example shows a way how the configuration management can be achieved for a similar use case.

In the example deployment the verbamr01 server exists. A new MR server has been started with a default configuration with the hostname verbamr02. With the recommended solution the common configurations should be collected in a configuration profile. In this case firstly, the used configuration profile should be determine with the following request:

Request:

Code Block
GET https://VFC_MR_DOMAIN/verba/restapi/v1/servers/verbamr01

Response:

Code Block
{
    "hostname": "verbamr01",
    "role": "MR",
    "configurationProfileId": 2,
    "description": null,
    "tasks": null
}

From this response the configurationProfileId can be read out. That configuration profile can be set to the new server with the following requests. Firstly get the current server object from the new verbamr02.

Request:

Code Block
GET https://VFC_MR_DOMAIN/verba/restapi/v1/servers/verbamr02

Response:

Code Block
{
    "hostname": "verbamr02",
    "role": "MR",
    "configurationProfileId": null,
    "description": "new server instance",
    "tasks": null
}

Then change the configurationProfileId value in the object to the previously retrieved value and send back for the update.

Code Block
PUT https://VFC_MR_DOMAIN/verba/restapi/v1/servers
Content-Type: application/json

{
    "hostname": "verbamr02",
    "role": "MR",
    "configurationProfileId": 2,
    "description": "new server instance",
    "tasks": null
}

For this scaling scenario the custom server configuration values should be collected and saved as a template. To retrieve these configuration use the export endpoint.

Request:

Code Block
GET https://VFC_MR_DOMAIN/verba/restapi/v1/servers/verbamr01/configuration/export?onlyServerCustomValues=true 

That request only lists those configuration that overwrite the configuration profile values. The configurations are stored in an XML schema.

Response:

Code Block
languagexml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
  <category base="\Verba" displayname="Server Certificate" name="api_sec">
    <item displayname="Verba Certificate Authority" isCustom="1" name="ApiCaCert" type="string">EF044E8HF74HF7HF894135B33E41FFC2W</item>
    <item displayname="Server Certificate" isCustom="1" name="ApiCert" type="string">FC3CEC46OI7744DHFIP917B92188C67C3RC</item>
  </category>
  <category base="\Verba" displayname="System" name="system">
    <category base="\Verba" displayname="API Connection" name="apiconnection">
      <item displayname="API URL" isCustom="1" name="ApiUrl" type="string">https://VFC_MR_DOMAIN/verba</item>
    </category>
  </category>
</config> 

That configuration list should used as a template. After changing the values in the template it can be send for an import to the new server with the following request:

Code Block
PUT https://VFC_MR_DOMAIN/verba/restapi/v1/servers/verbamr02/configuration/import
Content-Type: application/xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
  <category base="\Verba" displayname="Server Certificate" name="api_sec">
    <item displayname="Verba Certificate Authority" isCustom="1" name="ApiCaCert" type="string">G6782JGUFHI86894135B33E4RT10</item>
    <item displayname="Server Certificate" isCustom="1" name="ApiCert" type="string">ZU76P91RHOI7744DHFIP917BLKBL933J75JDG</item>
  </category>
  <category base="\Verba" displayname="System" name="system">
    <category base="\Verba" displayname="API Connection" name="apiconnection">
      <item displayname="API URL" isCustom="1" name="ApiUrl" type="string">https://VFC_MR_DOMAIN2/verba</item>
    </category>
  </category>
</config>

After the configuration changes the generated configuration tasks should be applied on the new server.

Code Block
POST https://VFC_MR_DOMAIN/verba/restapi/v1/servers/localhost/configurationTasks