Openwhisk: Feature Request: config api that specifies supported runtimes and limits

Created on 4 May 2016  路  10Comments  路  Source: apache/openwhisk

would it be possible to expose a config API that

1) enumerates the supported runtimes
2) specifies the universe of limits, along with their default and hard-limit values

so that the UI doesn鈥檛 have to hard-code this info. also, this will allow backend updates to expand or restrict these options without requiring a front-end redeploy

e.g. openwhisk.ng.bluemix.net/api/v1/config

API enhancement

All 10 comments

Update: the bluemix v2 UI now exposes timeout and memory quotas to the user. for now, we're (unpleasantly) hard-coding things in the UI: min, max, and default limits.

Linking #547 and #618.

Proposed patch #1980, produces this info subject to input and feedback:

> curl -k https://dockerhost
{
  "support": "https://github.com/openwhisk/openwhisk/issues",
  "description": "OpenWhisk",
  "build": "2017-03-08T08:06:28Z",
  "api_paths": ["/api/v1"],
  "buildno": "latest",
  "runtimes": {
    "python": [{
      "deprecated": false,
      "requireMain": false,
      "default": false,
      "attached": false,
      "kind": "python"
    }],
    "swift": [{
      "deprecated": true,
      "requireMain": false,
      "default": false,
      "attached": false,
      "kind": "swift"
    }, {
      "deprecated": false,
      "requireMain": false,
      "default": true,
      "attached": false,
      "kind": "swift:3"
    }],
    "java": [{
      "deprecated": false,
      "requireMain": true,
      "default": false,
      "attached": true,
      "kind": "java"
    }],
    "nodejs": [{
      "deprecated": false,
      "requireMain": false,
      "default": false,
      "attached": false,
      "kind": "nodejs"
    }, {
      "deprecated": false,
      "requireMain": false,
      "default": true,
      "attached": false,
      "kind": "nodejs:6"
    }]
  },
  "limits": {
    "actions_per_minute": 60,
    "triggers_per_minute": 60,
    "concurrent_actions": 30
  }
}

And for the "api" path:

> curl -k https://dockerhost/api/v1
{
  "min_cli_version": "2017-03-08T08:06:28Z",
  "api_version_path": "v1",
  "description": "OpenWhisk API",
  "min_recommended_cli_version": "2017-03-08T08:06:28Z",
  "swagger_paths": {
    "ui": "/docs",
    "api-docs": "/api-docs"
  },
  "build": "2017-03-08T08:06:28Z",
  "api_version": "1.0.0",
  "buildno": "latest"
}

Related to #1492.

Note: I didn't change the cli version to a semver yet (it's still a build date).

@rabbah this looks great, this means we need to update the swagger doc to describe this responses to the two endpoint /api/v1

I don't think we have swagger for /api/v1 or / but can add it once we settle on schema.

Yeah that's what I meant

The file extension might not be the same as language name so it would be helpful if you could add a file_suffix like .py for python, .rb for ruby, .pl for perl, etc. By parsing this data structure, clients could dynamically support new languages or reject requests for unsupported file extensions.

i just realized that #1980 does not enumerate the memory and log min/max system settings.

Yes; this is still open :) 1980 made the general facility available.

Was this page helpful?
0 / 5 - 0 ratings