VSF Cloud API

Most of the configuration option of our Cloud is available through our API.

Troubleshooting

Array is overwriten using PATCH method

In some cases, JSON objects can store a list of objects. When you try to update this kind of object array is replaced by a new array. It is valid as defined in RFC 7396: JSON Merge Patch (opens new window).

For example for an additional application configuration with environmet variables like below

{
  "additional_apps": {
    "apps": {
      "ct-adyen-integration-notification": {
        "name": "ct-adyen-integration-notification",
        "tag": "1.2.3",
        "image": "registry.vuestorefront.cloud/foo-storefrontcloud-io/ct-adyen-notification",
        "path": "/ct-adyen-integration-notification/",
        "has_base_path": false,
        "port": "80",
        "env_var": [
          {
            "name": "TEST",
            "value": "test"
          }
        ]
      }
    }
  }
}

whey you update the additional application configuration

curl -s -H 'X-User-Id: $CLOUD_USERNAME'  -H 'X-Api-Key: $CLOUD_PASSWORD' -H 'Content-Type: application/json' -X PATCH -d'
{
  "additional_apps": {
    "apps": {
      "ct-adyen-integration-notification": {
        "tag": "1.2.4",
        "env_var": [
          {
            "name": "NEW_TEST",
            "value": "new_test"
          }
        ]
      }
    }
  }
}' https://farmer.storefrontcloud.io/instance/<your-instance-namespace>

the result will be JSON like below

{
  "additional_apps": {
    "apps": {
      "ct-adyen-integration-notification": {
        "name": "ct-adyen-integration-notification",
        "tag": "1.2.4",
        "image": "registry.vuestorefront.cloud/foo-storefrontcloud-io/ct-adyen-notification",
        "path": "/ct-adyen-integration-notification/",
        "has_base_path": false,
        "port": "80",
        "env_var": [
          {
            "name": "NEW_TEST",
            "value": "new_test"
          }
        ]
      }
    }
  }
}