v1
Double column
API
CLI
JS Client

Addons /

Create addon

Creates a new addon

Required permission

Project > Addons > General > Create

Path parameters

    • projectId

      string required

      ID of the project

Request body

  • {object}
    • name

      string required

      The name of the addon.

      min length
      3
      max length
      20
      pattern
      ^[a-zA-Z](-?[a-zA-Z0-9]+((-|\s)[a-zA-Z0-9]+)*)?$
    • description

      string

      A description of the addon.

      max length
      200
      pattern
      ^[a-zA-Z0-9.,?\s\\/'"()[\];`%^&*\-_:!]+$
    • type

      string required

      The identifier for the type of addon. Addon types can be found at the Get Addon Types endpoint.

    • version

      string required

      The version of the addon type to use.

    • billing

      {object} required
      • deploymentPlan

        string required

        The ID of the deployment plan to use.

        pattern
        ^[A-Za-z0-9-]+$
      • storage

        integer required

        The size of the addon storage, in megabytes.

        min
        1
      • replicas

        integer required

        The number of addon replicas to run.

        min
        1
    • tlsEnabled

      boolean

      Enables access to the addon via TLS (if supported by the addon type).

    • externalAccessEnabled

      boolean

      Enables external access to the addon via TLS (if supported by the addon type).

Response body

  • {object}

    Response object.

    • data

      {object} required

      Result data.

      • id

        string required

        Identifier for the addon.

      • name

        string required

        Addon name.

      • appId

        string required

        Full identifier for the addon.

      • description

        string

        A short description of the addon.

      • createdAt

        string required

        The time the addon was created.

      • spec

        {object} required

        Details about the addon's specifications.

        • type

          string required

          The type of the addon

        • config

          {object} required

          Details about the addon configuration.

          • versionTag

            string required

            The version of the addon running.

          • lifecycleStatus

            string required

            The support status of the current addon version.

            one of
            active, deprecated, discontinued
          • deployment

            {object} required

            Details about the addon deployment.

            • replicas

              integer required

              The number of replicas running for this addon.

            • storageSize

              number required

              The size of the addon storage, in MB.

            • planId

              string required

              The deployment plan used by the addon.

            • region

              string required

              The region where the addon is deployed.

          • networking

            {object} required

            Details about the addon networking settings.

            • tlsEnabled

              boolean required

              Whether this addon is provisioned with a TLS certificate.

            • externalAccessEnabled

              boolean required

              Whether this addon is publicly accessible via the internet.

            • ipPolicies

              [array]

              An array of IP policy rules.

              • {object}

                Data about an IP policy rule.

                • address

                  string required

                  An IP address used by this rule.

                • action

                  string required

                  The action for this rule.

                  one of
                  DENY, ALLOW
      • status

        string required

        The current state of the addon.

        one of
        preDeployment, triggerAllocation, allocating, postDeployment, running, paused, scaling, upgrading, backup, restore, failed, deleting, deleted
API
CLI
JS Client

POST /v1/projects/{projectId}/addons

Example request

Request body

curl
curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"name":"Example Addon","description":"An addon description","type":"postgres","version":"12.4.0","billing":{"deploymentPlan":"nf-compute-20","storage":1024,"replicas":1}}' \
  https://api.northflank.com/v1/projects/{projectId}/addons

Example response

200 OK

Details about the newly created addon.

JSON

{
  "data": {
    "id": "example-addon",
    "name": "Example Addon",
    "appId": "/example-user/default-project/example-addon",
    "description": "This is the addon description",
    "createdAt": "2021-01-20T11:19:53.175Z",
    "spec": {
      "type": "mongodb",
      "config": {
        "versionTag": "4.2.14",
        "lifecycleStatus": "active",
        "deployment": {
          "replicas": 1,
          "storageSize": 1024,
          "planId": "nf-compute-20",
          "region": "europe-west"
        },
        "networking": {
          "tlsEnabled": true,
          "externalAccessEnabled": true,
          "ipPolicies": [
            {
              "address": "127.0.0.1",
              "action": "ALLOW"
            }
          ]
        }
      }
    },
    "status": "preDeployment"
  }
}

© 2021 Northflank Ltd. All rights reserved.