Configuration Repository

The Configuration Repository (CR) is a self-contained service for managing backups of:

  • Ua Namespace nodeset files
  • Apis Variable mapping files
  • Apis Hive configuration files

CR can compare different versions of backups to each other.

The CR API is implemented in gRPC.

Installation

CR is installed as a part of Apis Foundation. Remember to tick 'APIS ConfigRepository Server' in the install wizard. The service will typically be installed in the directory: 'C:\Program Files\APIS\ConfigRepositoryServer'

CR runs as a Windows service. The default port is 8237. The port can be changed in the configuration file, appsettings.json (Ioc.xml on older versions), see below. The configuration file can be found in the installation directory.

CR depends on PostgreSQL as its datastore (install it if not present). Connection details for the PostgreSQL database must be entered in the configuration file, see below. CR needs PostgreSQL credentials in the appsettings.json file to work correctly

Backup files are placed on the disk. The location for these files can be set in the configuration file, see below.

When doing a namespace diff, the namespace may have dependencies on other namespaces. For the diff to succeed, it needs access to these namespaces. Nodesetfile for these other namespaces can be placed in the folder defined in in the configuration file.

Locate the configuration file in the install directory and setup PostgreSQL settings.

appsettings.json:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*",
  "Kestrel": {
    "EndpointDefaults": {
      "Protocols": "Http2"
    },
    "Endpoints": {
      "Grpc": {
        "Protocols": "Http2",
        "Url": "http://0.0.0.0:8237" // CR Service endpoint
      }
    }
  },
  "ServiceConfig": {
    "RootStore": "C:\\Data\\ConfigServiceStore",	 // Place on disk to store backup files
    "TypelibStore": "C:\\Data\\TypelibStore",	// Location for additional namespaces needed to perform namespace diff.
    "DBUser": "postgres",		// PostgreSQL username
    "DBHost": "localhost",		// PostgreSQL host
    "DBPort": 5432,				// PostgreSQL port
    "DBName": "cfgdb",			// PostgreSQL database
    "DBPwd": "tokamap"			// PostgreSQL password
  }
}

Internal structure

The structure inside CR is organized as a hierarchy

  • Level 1: Folders
  • Level 2: Stores
  • Level 3: Revisions
  • Level 4: Content

Folders

Folders can be nested to the users choosing. Only folders can be at the root of the repository. The users are free to organize a folder hierarchy.

Stores

Stores are containers for Revisions (backups). A store is of one specific type, Namespace, Variable Mapping or Hive Configuration.

  • A Store of type Namespace can store nodeset2.xml file only.
  • A Store of type Variable Mapping can store Apis hive config files only (text).
  • A Store of type Hive Config can store Hive configuration backups only (zip).

Revisions

Revisions can be added to Stores only and must be of the same type as the Store. A Revision is a placeholder for an actual backup (Content). The revision contains metadata for the backup like, name, description, version, date and more.

A Revisions type must correspond to the type of the Store it belongs to. I.e., a Revision for a namespace can only belong to a Store for namespaces.

Content

Content is an actual backup file. Content is always associated with a Revision.

A Content file might be:

  • nodeset2.xml file for an Ua Namespace
  • Hive config text file for Variable Mapping
  • Hive backup zip file for Hive Configuration

Compare Revisions

Revisions in the same Store can be compared to one another. One revision is selected as base, the other as "compare to". The result will be sets of Added/Deleted/Modified from the viewpoint of the base. The diff-results for the 3 different types are quite different, look in the API description below for the details.

Remote connection

To receive connections from remote computers, you need to open the port for CR in the firewall, see: Configuration Repository - Open Firewall

Best practices

Take some time to layout a good folder naming and hierarchy for your organization. A good layout makes it easy to find your backups later.

Make one store for each Namespace, don't have different namespaces in the same store.

Make one store for each namespace's Variable Mappings.

Make one store for each Hive for your Hive Configurations.

API reference

Configuration Repository API

Common proto messages