API Firebird.conf (English)

Current API version 1.0.240924
See versions of this instruction in English Portuguese Spanish German  Russian

How to use API of Configuration Calculator for Firebird SQL

To obtain a configuration with custom parameters via API, you need to perform the following steps:

1) Register

You need to register on the portal cc.ib-aid.com; Only a working email is required.

2) Get the API password

The API call password is individual for each registered user. It is provided on the main page in the widget "Get Firebird configuration via API".

3) Form server data

To generate the Firebird configuration, you need to transmit data about the server or VM characteristics in json format.

The server or VM characteristics data should have the following form:


data = {
    "mailLogin": "test",
    "passApi": "testparol",
    "serverVersion": "fb3",
    "serverArchitecture": "Classic",
    "cores": 8,
    "countUsers": 100,
    "sizeDb": 100,
    "pageSize": 4096,
    "ram": 16,
    "nameMainDb": "mainVM",
    "pathToMainDb": "c:/test/test.fdb",
    "osType": "Universal",
    "hwType": "Universal"
}
    

where

  • mailLogin - login for portal access, obtained during registration,
  • passApi - password for the API (see Point 2)
  • serverVersion - firebird or hqbird server version should be specified as follows: fb+version number or hq+version number. For example, fb2.5 - for Firebird 2.5 server or hq5 -- for HQBird 5 server
  • serverArchitecture -- server architecture. The parameter can take one of the values: Classic, SuperClassic or SuperServer
  • cores --- number of server cores. From 1 to 100;
  • countUsers - number of users. Minimum value - 1, maximum - 30000;
  • sizeDb -- database size;
  • pageSize --- set page size. Values can be 4096, 8192, 16384 or 32768;
  • ram -- server RAM. Minimum value - 4, maximum --- 10000;
  • nameMainDb -- name of the main database. String length should not exceed 100 characters;
  • pathToMainDb -- path to the main database. String length should not exceed 200 characters;
  • osType -- name of the operating system where the server is used. The parameter value can be Windows, Linux or Universal; in API version 1.0.240924 this parameter is always set to Universal.
  • hwType -- The parameter can take one of the values: Hardware, Virtual or Universal; in API version 1.0.240924 this parameter is always set to Universal.

4) Request the API

You need to make an API call

"https://cc.ib-aid.com/rest/clc/calculation-params"

5) Get the results

The result of the call will be a JSON file with the following fields:

{ 'inputParameters': '', 'configurationFirebird': '', 'configurationDatabase': '', 'messageError': ''}

You can see an example below.

6) Error handling

If an error occurred while receiving data, it will be displayed in the messageError field:

{'inputParameters':'','configurationFirebird': '', 'configurationDatabase': '', 'messageError': 'Count of users is null. Please, set value.'}

7) Parameters specification features

If a parameter does not participate in the calculation, its value will be ignored. You can omit parameters that are not used in calculations.

Depending on the versions and architectures of servers, the set of necessary input parameters changes:

  • For Firebird 2.5 and HQbird 2.5 Classic and SuperClassic servers, the sufficient parameters are ram, countUsers and pageSize,
  • For 2.5 SuperServer, no parameters need to be filled.
  • For all server versions 3.0, 4.0, 5.0 and Classic and SuperClassic architectures, you need to specify ram, countUsers, cores and pageSize.
  • For the SuperServer architecture of versions 3.0, 4.0, 5.0, all parameters need to be defined.

Examples

Example of API connection call in Python


import requests

URL = "https://cc.ib-aid.com"
URLEND="/rest/clc/calculation-params"

data={
    "mailLogin":"test",
    "passApi":"testpassword",
    "serverVersion":"fb3",
    "serverArchitecture":"Classic",
    "cores":8,
    "countUsers":10,
    "sizeDb":100,
    "pageSize":4096,
    "ram":16,
    "nameMainDb":"mainBD",
    "pathToMainDb":"c:/test/test.fdb",
    "osType":"Universal",
    "hwType":"Universal"
}
r = requests.post(URL+URLEND,json=data)
print(r.status_code)
print(r.json())
    

Example of API call in Java


package com.rest;
import java.io.Serializable;

public class ResultRest implements Serializable {

    private String configurationFirebird= "";
    private String configurationDatabase="";
    private String messageError="";
    private String inputParameters="";

    public String getInputParameters() {
        return inputParameters;
    }

    public String getConfigurationFirebird() {
        return configurationFirebird;
    }
    public String getConfigurationDatabase() {
        return configurationDatabase;
    }
    public String getMessageError() {
        return messageError;
    }
}

package com.rest;

import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
import org.json.simple.JSONObject;

public class CalculateRest {
    public static final String SERVER_URI = "https://cc.ib-aid.com";
    public static final String PUT_PARAMS = "/rest/clc/calculation-params";

    public static void main(String args[]){
        getCalcResult();
    }
    private static void getCalcResult() {
        try {
            RestTemplate restTemplate = new RestTemplate();
            JSONObject jobj = new JSONObject();
            jobj.put("serverArchitecture","classic");
            jobj.put("cores",1);
            jobj.put("countUsers",100);
            jobj.put("sizeDb",100);
            jobj.put("pageSize",4096);
            jobj.put("ram",200);
            jobj.put("serverVersion","fb2.5");
            jobj.put("nameMainDb","mainBD");
            jobj.put("pathToMainDb","c://test/test.fdb");
            jobj.put("osType","Universal");
            jobj.put("hwType","Universal");
            jobj.put("mailLogin","test");
            jobj.put("passApi","testpassword");
            ResultRest y = restTemplate.postForObject(SERVER_URI+PUT_PARAMS,jobj,ResultRest.class);
            System.out.println(y.getInputParameters());
            System.out.println(y.getConfigurationFirebird());
            System.out.println(y.getConfigurationDatabase());
            System.out.println(y.getMessageError());

        } catch (HttpClientErrorException e) {
            // Handle HTTP client errors (4xx status codes)
            if (e.getStatusCode().is4xxClientError()) {
                System.err.println("Client error: " + e.getStatusCode() + " - " + e.getStatusText());
                System.err.println("Response Body: " + e.getResponseBodyAsString());
            } else {
                System.err.println("Unexpected HTTP status: " + e.getStatusCode());
            }
        } catch (Exception ex){
            System.err.println("An error occurred: " + ex.getMessage());
        }
    }
}
    

Example of obtained configuration


#{"mailLogin":"[email protected]","ram":16,"countUsers":100,"sizeDb":100,"cores":8,"pageSize":8192,"nameMainDb":"testdb","pathToMainDb":"c:\\test\\test.fdb"}

#Configuration for Firebird 3 (vanilla) Classic (64 bit)

ServerMode = Classic # Firebird Classic

DefaultDBCachePages = 2048

FileSystemCacheThreshold = 64K

TempCacheLimit = 32M

LockHashSlots = 65519 # slots

LockMemSize = 50M

MaxUnflushedWrites = -1

MaxUnflushedWriteTime = -1

WireCrypt = Enabled

RemoteServicePort = 3050

#authentication plugin setup

# Recommendation - use SELECT * FROM SEC$USERS
# to check that you have users for all plugins

AuthServer = Srp, Legacy_Auth

UserManager = Srp, Legacy_UserManager

#security database

security.db = $(dir_secDb)/security3.fdb

{
    RemoteAccess = false
    DefaultDbCachePages = 250
}
    

Support

For all questions regarding the use of the configuration calculator, please write to [email protected]