The mogenius REST API allows you to manage your mogenius workspaces and resources in scripts, automations, and third party tools.

Creating an API key

To authenticate with the mogenius API, first create an API key. You can do this on cluster level, or workspace level. Go to the section API key in the respective settings and add a new key by filling out the form:

  • Set a name to identify the API key later.
  • Define the expiration date.
  • Set the scope based on the pre-defined groups.

Set Image

You can use the API to perform a set image for your deployments via the mogenius operator.

curl --location 'https://platform-api.mogenius.com/workspace/workload/set-image' \
--header 'Authorization: bearer YOUR_WORKSPACE_API_KEY' \
--data '{
    "kind": "Deployment",
    "namespace": "YOUR_NAMESPACE",
    "resourceName": "DEPLOYMENT_NAME",
    "containerName": "CONTAINER_NAME",
    "image": "CONTAINER_IMAGE"
}'

Helm Upgrade

You can use the API to perform a Helm upgrade on a Helm release via the mogenius operator. For this to work, the Helm repository must be installed on the cluster first. The variable REPO_NAME in the request below refers to this Helm repository.

The Helm upgrade can be performed with an API key on workspace level, or cluster level.

curl --location --request PATCH 'https://platform-api.mogenius.com/workspace/helm/release/upgrade' \
--header 'Authorization: bearer YOUR_WORKSPACE_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "namespace": "YOUR_NAMESPACE",
    "chart": "CHART_NAME", // REPO_NAME/CHART_NAME
    "release": "RELEASE_NAME",
    "version": "UPGRADE_TO_VERSION",
    "values": {
        "key1":"value1" // can also be a yaml string
    },
    "dryRun": false
}'

Detailed API reference