Configuration in KDB-X DB Service¶
This page describes how to target a specific assembly in the KDB-X DB Service, and how to export an assembly configuration.
Assembly configuration¶
The DB Service is configured using an assembly — a YAML document that defines the assembly name and labels, table schemas, stream bus settings, storage mounts, and service elements such as Storage Manager tiers and DAP mounts.
You can export the configuration of an assembly. This is useful for reviewing the current configuration, or as a reference when preparing a new deployment.
Refer to the API spec for detailed reference, including examples for all APIs. Sample notebooks demonstrating API usage are bundled with the DB Service repo on GitHub.
Assembly selection¶
The DB Service can be configured with more than one assembly. Each assembly has its own independent set of tables, so a request always targets a single assembly.
-
Single-assembly deployments — the assembly is selected automatically, and the
assemblyparameter is optional. -
Multi-assembly deployments — identify the target assembly with the
assemblyquery parameter, for exampleGET /api/v0/tables?assembly=marketdata-emea. The parameter is required.
Assembly selection applies to the table management, import, and assembly export APIs.
The following conditions return 400:
| Condition | Error |
|---|---|
| Parameter omitted when the service is configured with more than one assembly | assembly must be specified when the service is configured with more than one assembly |
| Name does not match a configured assembly | unknown assembly: marketdata-emea |
Export assembly¶
The export assembly endpoint is GET /api/v0/config/assembly. The response body is the assembly YAML document itself, not a JSON wrapper.
Example export assembly¶
// Return the assembly YAML as a string
assemblyYaml:session.exportAssembly[]
// Save the assembly YAML to a file
session.exportAssembly["assembly.yaml"]
# Return the assembly YAML as a string
assembly_yaml = session.export_assembly()
print(assembly_yaml)
# Save the assembly YAML to a file
session.export_assembly(filename="assembly.yaml")
curl -X GET "http://localhost:8080/api/v0/config/assembly" \
-H "Accept: application/yaml"
Next steps¶
- Refer to the DB Service repo for further details and examples.
- See the REST APIs for reference.
- Learn more about table management and query.