Skip to main content

Configmonkey - API Reference (0.0.1)

URL: https://madoke.org License: MIT

Find out more about config monkey in the github repo.

Overview

Configmonkey's data architecture is structured in three main entities: Domains, Configs and Versions. Domains are for logical grouping of related configs, which are usually translated to config files, applications, environments or any combination of those in the real world. Configs hold the metadata about a specific item to enable any kind of processing and management features not related to the value itself (example: Auditing, UI editors, Parsing etc.), and finally Versions hold the actual values and their history as the value changes during the config lifetime

The first step to start managing configs with configmonkey is to create a domain that represents the scope we want to manage (example: my-app-staging). Then for each dynamic config that we want to add to our domain, a config needs to be created, and last but not least, at least one version needs to be added to each config, so that they actually contain values.

Domains

Domains are used for logical grouping of related configs, which are usually config files, applications, environments or any combination of those in real world applications.

Get domains

Returns a paginated list containing available domains. Navigation can be done by adjusting the limit and offset parameters

query Parameters
limit
integer <int32> (Limit)
Default: 10
Example: limit=5

Maximum entries to request

offset
integer <int32> (Offset)
Default: 0
Example: offset=5

Maximum entries to skip

Responses

Response Schema: application/json
Array of objects (Domain)
object (Pagination)

Contains information on the current position and how to navigate a list

Response samples

Content type
application/json
Example
{
  • "data": [
    • {
      • "slug": "configmonkey",
      • "created_at": "2023-08-13T00:00:00Z"
      },
    • {
      • "slug": "foo",
      • "created_at": "2023-08-13T00:00:00Z"
      }
    ],
  • "pagination": {
    • "count": 2,
    • "offset": 2,
    • "limit": 2,
    • "next": "/v1/domains?limit=2&offset=2",
    • "prev": "/v1/domains?limit=2&offset=0"
    }
}

Create domain

Creates a new domain. The slug must be unique (to be used in URI paths for navigation) and must match the Slug regular expression.

Request Body schema: application/json

Create a new domain

slug
string^[a-zA-Z0-9\-\_]+$

The domain's unique slug

Responses

Response Schema: application/json
slug
string^[a-zA-Z0-9\-\_]+$

The domain's unique slug to be used in URI paths

created_at
string <date-time>

Date when the domain was created

Request samples

Content type
application/json
{
  • "slug": "configmonkey"
}

Response samples

Content type
application/json
{
  • "value": {
    • "slug": "configmonkey",
    • "created_at": "2023-10-29T19:51:08.418905Z"
    }
}

Delete domain

Deletes an existing domain. The domain must not have any created configuration, otherwise it will fail

path Parameters
domain_slug
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The domain slug

Responses

Response samples

Content type
application/json
{
  • "code": "not_found",
  • "message": "Domain not found"
}

Configs

Configs hold the metadata about a specific item to enable any kind of processing and management features not related to the value itself.

Get configs

Retrieves the list of config values under a given domain.

path Parameters
domain_slug
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The domain slug

Responses

Response Schema:
Array of objects (Config)
object (Pagination)

Contains information on the current position and how to navigate a list

Response samples

Content type
{
  • "data": [
    • {
      • "key": "database_url",
      • "created_at": "2023-10-29T19:51:08.418905Z"
      }
    ],
  • "pagination": {
    • "count": 5,
    • "offset": 5,
    • "limit": 5,
    • "next": "/v1/domains?limit=5&offset=10",
    • "prev": "/v1/domains?limit=15&offset=0"
    }
}

Create config

Creates a new config under the given domain

path Parameters
domain_slug
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The domain slug

Request Body schema: application/json

Create a new config

key
string^[a-zA-Z0-9\-\_]+$

The config key (variable name)

Responses

Response Schema: application/json
key
string

The config key

created_at
string <date-time>

Date when the config was created

Request samples

Content type
application/json
{
  • "key": { }
}

Response samples

Content type
application/json
{
  • "key": "database_url",
  • "created_at": "2023-10-29T19:51:08.418905Z"
}

Get config

Retrieves a specific config

path Parameters
domain_slug
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The domain slug

key
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The config key

Responses

Response Schema: application/json
key
string

The config key

created_at
string <date-time>

Date when the config was created

Response samples

Content type
application/json
{
  • "key": "database_url",
  • "created_at": "2023-10-29T19:51:08.418905Z"
}

Delete config

Remove an existing config and all its versions

path Parameters
domain_slug
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The domain slug

key
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The config key

Responses

Response samples

Content type
application/json
{
  • "code": "config_not_found",
  • "message": "Config not found"
}

Get config versions

Retrieves all versions of a given config.

path Parameters
domain_slug
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The domain slug

key
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The config key

Responses

Response Schema: application/json
Array of objects (Version)
object (Pagination)

Contains information on the current position and how to navigate a list

Response samples

Content type
application/json
Example
{
  • "data": [
    • {
      • "id": 2,
      • "created_at": "2023-08-13T00:00:00Z",
      • "value": 5432
      },
    • {
      • "id": 1,
      • "created_at": "2023-08-13T00:00:00Z",
      • "value": 4000
      }
    ],
  • "pagination": {
    • "count": 2,
    • "offset": 2,
    • "limit": 2,
    • "next": "/v1/configs/configmonkey/database_port/versions?limit=2&offset=2",
    • "prev": "/v1/configs/configmonkey/database_port/versions?limit=2&offset=0"
    }
}

Create config version

Creates a new version for a given config

path Parameters
domain_slug
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The domain slug

key
required
string (Slug) ^[a-zA-Z0-9\-\_]+$
Examples: configmonkey config-monkey configmonkey01

The config key

Request Body schema: application/json

Create a new version

number or string or boolean

The value assigned to this version

One of
number

The value assigned to this version

Responses

Response Schema: application/json
id
number

The version id (positive integer)

created_at
string <date-time>

Date when the version was created

number or string or boolean

The value assigned to this version

Request samples

Content type
application/json
{
  • "value": 1
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "created_at": "2023-10-29T19:51:08.418905Z",
  • "value": 1
}

Domain

slug
string^[a-zA-Z0-9\-\_]+$

The domain's unique slug to be used in URI paths

created_at
string <date-time>

Date when the domain was created

{
  • "slug": "configmonkey",
  • "created_at": "2023-10-29T19:51:08.418905Z"
}

Config

key
string

The config key

created_at
string <date-time>

Date when the config was created

{
  • "key": "database_url",
  • "created_at": "2023-10-29T19:51:08.418905Z"
}

Version

id
number

The version id (positive integer)

created_at
string <date-time>

Date when the version was created

number or string or boolean

The value assigned to this version

{
  • "id": 1,
  • "created_at": "2023-10-29T19:51:08.418905Z",
  • "value": 1
}