Apache OpenWhisk REST API

The OpenWhisk API provides REST endpoints for managing actions, triggers, rules, packages, and activations, supporting serverless function development in JavaScript, Python, Swift, Java, Go, PHP, and custom Docker runtimes.

OpenAPI Specification

apache-openwhisk-rest-api.yaml Raw ↑
openapi: 3.0.3
info:
  title: Apache OpenWhisk REST API
  description: Apache OpenWhisk is an open-source serverless cloud platform. The REST API provides endpoints for managing actions, triggers, rules, packages, and activations for serverless function development.
  version: 1.0.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  contact:
    url: https://openwhisk.apache.org/
x-generated-from: documentation
servers:
  - url: https://{host}/api/v1
    description: Apache OpenWhisk API server
    variables:
      host:
        default: localhost:443

security:
  - basicAuth: []

paths:
  /namespaces:
    get:
      operationId: listNamespaces
      summary: Apache OpenWhisk List Namespaces
      description: Fetch a list of namespaces accessible to the authenticated user.
      tags: [Namespaces]
      responses:
        '200':
          description: List of namespaces
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}:
    get:
      operationId: getNamespace
      summary: Apache OpenWhisk Get Namespace
      description: Get entities available in a namespace.
      tags: [Namespaces]
      parameters:
        - $ref: '#/components/parameters/namespace'
      responses:
        '200':
          description: Namespace entities
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespaceEntities'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/limits:
    get:
      operationId: getNamespaceLimits
      summary: Apache OpenWhisk Get Namespace Limits
      description: Get the resource limits for a namespace.
      tags: [Namespaces]
      parameters:
        - $ref: '#/components/parameters/namespace'
      responses:
        '200':
          description: Namespace limits
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NamespaceLimits'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/actions:
    get:
      operationId: listActions
      summary: Apache OpenWhisk List Actions
      description: List all actions in the namespace.
      tags: [Actions]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - name: limit
          in: query
          schema:
            type: integer
            default: 30
          description: Maximum number of actions to return
        - name: skip
          in: query
          schema:
            type: integer
            default: 0
          description: Number of actions to skip
      responses:
        '200':
          description: List of actions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Action'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/actions/{actionName}:
    get:
      operationId: getAction
      summary: Apache OpenWhisk Get Action
      description: Get an action by name from the namespace.
      tags: [Actions]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/actionName'
      responses:
        '200':
          description: Action details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Action'
        '404':
          description: Action not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: createOrUpdateAction
      summary: Apache OpenWhisk Create or Update Action
      description: Create or update an action in the namespace.
      tags: [Actions]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/actionName'
        - name: overwrite
          in: query
          schema:
            type: boolean
          description: Whether to overwrite an existing action
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActionRequest'
      responses:
        '200':
          description: Action created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Action'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: invokeAction
      summary: Apache OpenWhisk Invoke Action
      description: Invoke an action and optionally wait for the result.
      tags: [Actions]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/actionName'
        - name: blocking
          in: query
          schema:
            type: boolean
          description: Block and wait for result
        - name: result
          in: query
          schema:
            type: boolean
          description: Return only the result field
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Input parameters for the action
      responses:
        '200':
          description: Action activation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Activation'
        '202':
          description: Action invoked asynchronously
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivationRef'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteAction
      summary: Apache OpenWhisk Delete Action
      description: Delete an action from the namespace.
      tags: [Actions]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/actionName'
      responses:
        '200':
          description: Action deleted
        '404':
          description: Action not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/triggers:
    get:
      operationId: listTriggers
      summary: Apache OpenWhisk List Triggers
      description: List all triggers in the namespace.
      tags: [Triggers]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - name: limit
          in: query
          schema:
            type: integer
          description: Maximum number of triggers to return
      responses:
        '200':
          description: List of triggers
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Trigger'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/triggers/{triggerName}:
    get:
      operationId: getTrigger
      summary: Apache OpenWhisk Get Trigger
      description: Get a trigger by name.
      tags: [Triggers]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/triggerName'
      responses:
        '200':
          description: Trigger details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trigger'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: createOrUpdateTrigger
      summary: Apache OpenWhisk Create or Update Trigger
      description: Create or update a trigger.
      tags: [Triggers]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/triggerName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TriggerRequest'
      responses:
        '200':
          description: Trigger created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trigger'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: fireTrigger
      summary: Apache OpenWhisk Fire Trigger
      description: Fire a trigger, activating all associated rules.
      tags: [Triggers]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/triggerName'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: Trigger payload
      responses:
        '200':
          description: Trigger fired
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivationRef'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteTrigger
      summary: Apache OpenWhisk Delete Trigger
      description: Delete a trigger.
      tags: [Triggers]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/triggerName'
      responses:
        '200':
          description: Trigger deleted
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/rules:
    get:
      operationId: listRules
      summary: Apache OpenWhisk List Rules
      description: List all rules in the namespace.
      tags: [Rules]
      parameters:
        - $ref: '#/components/parameters/namespace'
      responses:
        '200':
          description: List of rules
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Rule'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/rules/{ruleName}:
    get:
      operationId: getRule
      summary: Apache OpenWhisk Get Rule
      description: Get a rule by name.
      tags: [Rules]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/ruleName'
      responses:
        '200':
          description: Rule details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: createOrUpdateRule
      summary: Apache OpenWhisk Create or Update Rule
      description: Create or update a rule linking a trigger to an action.
      tags: [Rules]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/ruleName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleRequest'
      responses:
        '200':
          description: Rule created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Rule'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      operationId: updateRuleStatus
      summary: Apache OpenWhisk Update Rule Status
      description: Enable or disable a rule.
      tags: [Rules]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/ruleName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum: [active, inactive]
      responses:
        '200':
          description: Rule status updated
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deleteRule
      summary: Apache OpenWhisk Delete Rule
      description: Delete a rule.
      tags: [Rules]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/ruleName'
      responses:
        '200':
          description: Rule deleted
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/packages:
    get:
      operationId: listPackages
      summary: Apache OpenWhisk List Packages
      description: List all packages in the namespace.
      tags: [Packages]
      parameters:
        - $ref: '#/components/parameters/namespace'
      responses:
        '200':
          description: List of packages
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Package'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/packages/{packageName}:
    get:
      operationId: getPackage
      summary: Apache OpenWhisk Get Package
      description: Get a package by name.
      tags: [Packages]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/packageName'
      responses:
        '200':
          description: Package details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Package'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      operationId: createOrUpdatePackage
      summary: Apache OpenWhisk Create or Update Package
      description: Create or update a package.
      tags: [Packages]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/packageName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PackageRequest'
      responses:
        '200':
          description: Package created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Package'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      operationId: deletePackage
      summary: Apache OpenWhisk Delete Package
      description: Delete a package.
      tags: [Packages]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - $ref: '#/components/parameters/packageName'
      responses:
        '200':
          description: Package deleted
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/activations:
    get:
      operationId: listActivations
      summary: Apache OpenWhisk List Activations
      description: List activations in the namespace.
      tags: [Activations]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - name: limit
          in: query
          schema:
            type: integer
            default: 30
          description: Maximum number of activations to return
        - name: skip
          in: query
          schema:
            type: integer
          description: Number of activations to skip
        - name: since
          in: query
          schema:
            type: integer
          description: Return activations since this epoch milliseconds timestamp
        - name: upto
          in: query
          schema:
            type: integer
          description: Return activations up to this epoch milliseconds timestamp
      responses:
        '200':
          description: List of activations
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivationSummary'
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

  /namespaces/{namespace}/activations/{activationId}:
    get:
      operationId: getActivation
      summary: Apache OpenWhisk Get Activation
      description: Get details of a specific activation.
      tags: [Activations]
      parameters:
        - $ref: '#/components/parameters/namespace'
        - name: activationId
          in: path
          required: true
          schema:
            type: string
          description: Activation identifier
          example: 44794bd6aab74415b4e42a308d880727
      responses:
        '200':
          description: Activation details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Activation'
        '404':
          description: Activation not found
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK

components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication using OpenWhisk credentials

  parameters:
    namespace:
      name: namespace
      in: path
      required: true
      description: OpenWhisk namespace
      schema:
        type: string
        example: guest
    actionName:
      name: actionName
      in: path
      required: true
      description: Action name
      schema:
        type: string
        example: hello
    triggerName:
      name: triggerName
      in: path
      required: true
      description: Trigger name
      schema:
        type: string
        example: myTrigger
    ruleName:
      name: ruleName
      in: path
      required: true
      description: Rule name
      schema:
        type: string
        example: myRule
    packageName:
      name: packageName
      in: path
      required: true
      description: Package name
      schema:
        type: string
        example: myPackage

  schemas:
    KeyValue:
      type: object
      properties:
        key:
          type: string
          description: Parameter key
          example: name
        value:
          description: Parameter value
          example: World

    ActionExec:
      type: object
      properties:
        kind:
          type: string
          description: Runtime kind
          example: nodejs:18
          enum: [nodejs:18, nodejs:20, python:3, java:8, go:1.20, php:8.0, ruby:2.5, swift:5.7, dotnet:2.2, docker, blackbox, sequence]
        code:
          type: string
          description: Inline function source code
          example: "function main(params) { return { message: 'Hello ' + (params.name || 'World') }; }"
        image:
          type: string
          description: Docker image for blackbox/docker kind
          example: openwhisk/nodejs18action
        components:
          type: array
          items:
            type: string
          description: Sequence of action names (for sequence kind)

    Action:
      type: object
      properties:
        namespace:
          type: string
          description: Namespace owning the action
          example: guest
        name:
          type: string
          description: Action name
          example: hello
        version:
          type: string
          description: Action version
          example: 0.0.1
        publish:
          type: boolean
          description: Whether the action is public
          example: false
        exec:
          $ref: '#/components/schemas/ActionExec'
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        limits:
          $ref: '#/components/schemas/ActionLimits'
        updated:
          type: integer
          description: Last update timestamp (epoch ms)
          example: 1718153645993

    ActionRequest:
      type: object
      required: [exec]
      properties:
        exec:
          $ref: '#/components/schemas/ActionExec'
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        limits:
          $ref: '#/components/schemas/ActionLimits'

    ActionLimits:
      type: object
      properties:
        timeout:
          type: integer
          description: Timeout in milliseconds
          example: 60000
        memory:
          type: integer
          description: Memory in MB
          example: 256
        logs:
          type: integer
          description: Log size limit in MB
          example: 10

    Trigger:
      type: object
      properties:
        namespace:
          type: string
          example: guest
        name:
          type: string
          example: myTrigger
        version:
          type: string
          example: 0.0.1
        publish:
          type: boolean
          example: false
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        updated:
          type: integer
          example: 1718153645993

    TriggerRequest:
      type: object
      properties:
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'

    Rule:
      type: object
      properties:
        namespace:
          type: string
          example: guest
        name:
          type: string
          example: myRule
        version:
          type: string
          example: 0.0.1
        status:
          type: string
          enum: [active, inactive]
          example: active
        trigger:
          type: string
          description: Fully qualified trigger name
          example: /guest/myTrigger
        action:
          type: string
          description: Fully qualified action name
          example: /guest/hello
        updated:
          type: integer
          example: 1718153645993

    RuleRequest:
      type: object
      required: [trigger, action]
      properties:
        trigger:
          type: string
          description: Trigger name to associate
          example: /guest/myTrigger
        action:
          type: string
          description: Action name to invoke
          example: /guest/hello

    Package:
      type: object
      properties:
        namespace:
          type: string
          example: guest
        name:
          type: string
          example: myPackage
        version:
          type: string
          example: 0.0.1
        publish:
          type: boolean
          example: false
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        actions:
          type: array
          items:
            $ref: '#/components/schemas/EntityRef'
        feeds:
          type: array
          items:
            $ref: '#/components/schemas/EntityRef'
        updated:
          type: integer
          example: 1718153645993

    PackageRequest:
      type: object
      properties:
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'
        parameters:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'

    EntityRef:
      type: object
      properties:
        name:
          type: string
          description: Entity name
          example: hello
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'

    Activation:
      type: object
      properties:
        activationId:
          type: string
          description: Unique activation identifier
          example: 44794bd6aab74415b4e42a308d880727
        namespace:
          type: string
          example: guest
        name:
          type: string
          description: Name of invoked action/trigger
          example: hello
        version:
          type: string
          example: 0.0.1
        subject:
          type: string
          description: Subject who invoked the action
          example: guest
        start:
          type: integer
          description: Start time epoch ms
          example: 1718153645993
        end:
          type: integer
          description: End time epoch ms
          example: 1718153646050
        duration:
          type: integer
          description: Duration in milliseconds
          example: 57
        response:
          $ref: '#/components/schemas/ActivationResponse'
        logs:
          type: array
          items:
            type: string
          description: Activation log output
        annotations:
          type: array
          items:
            $ref: '#/components/schemas/KeyValue'

    ActivationResponse:
      type: object
      properties:
        status:
          type: string
          description: Activation status
          example: success
          enum: [success, application error, developer error, whisk internal error]
        statusCode:
          type: integer
          description: HTTP status code equivalent
          example: 0
        success:
          type: boolean
          example: true
        result:
          type: object
          description: Action result payload

    ActivationRef:
      type: object
      properties:
        activationId:
          type: string
          description: Activation identifier for async invocations
          example: 44794bd6aab74415b4e42a308d880727

    ActivationSummary:
      type: object
      properties:
        activationId:
          type: string
          example: 44794bd6aab74415b4e42a308d880727
        name:
          type: string
          example: hello
        version:
          type: string
          example: 0.0.1
        start:
          type: integer
          example: 1718153645993
        end:
          type: integer
          example: 1718153646050

    NamespaceEntities:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/EntityRef'
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/EntityRef'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/EntityRef'

    NamespaceLimits:
      type: object
      properties:
        concurrency:
          type: integer
          description: Maximum concurrent activations
          example: 1000
        minuteRate:
          type: integer
          description: Actions per minute limit
          example: 600
        hourRate:
          type: integer
          description: Actions per hour limit
          example: 36000