Cloud Functions

Introduction

IBM Cloud Functions is a distributed compute service that executes application logic in response to requests from web or mobile apps. You can set up specific actions to occur based on HTTP-based API requests from web apps or mobile apps, and from event-based requests from services like Cloudant. Functions can run your code snippets on demand or automatically in response to events.

All APIs are protected with HTTP Basic authentication. You can use the wskadmin tool to generate a new namespace and authentication. The Basic authentication credentials are in the AUTH property in your ~/.wskprops file, delimited by a colon. You can also retrieve these credentials by using the CLI running bx wsk property get --auth.

In the following cURL example, authentication is passed by using the -u flag: curl -u USERNAME:PASSWORD https://openwhisk.ng.bluemix.net/api/v1/namespaces.
You can also include authentication part of the URL: curl https://USERNAME:PASSWORD@openwhisk.ng.bluemix.net/api/v1/namespaces.

For the {namespace} in the URL, the underscore character (_) can be used to specify the user's default namespace.

Base URL
https://openwhisk.ng.bluemix.net

Reference

Get all namespaces

Cloud Functions Actions, Triggers, rules, and sometimes packages belong in a namespace. An IBM Cloud organization and space pair corresponds to a Cloud Functions namespace. For example, the organization BobsOrg and space dev would correspond to the Cloud Functions namespace /BobsOrg_dev. Users can also create namespaces. The /whisk.system namespace is reserved for entities that are distributed with the Cloud Functions system.

GET
/namespaces
Request

No Request Parameters

This endpoint does not accept any request parameters.

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces \
  --header 'accept: application/json'
Response

No Response Details

This endpoint does not specify any response properties.

Status 200

"ARRAY"

Status 401

{
  "code": "STRING",
  "error": "STRING"
}

Status 500

{
  "code": "STRING",
  "error": "STRING"
}

Get all actions

Get all actions in a namespace.

GET
/namespaces/{namespace}/actions
Request

Path Parameters

  • The entity namespace

Query Parameters

  • Number of entities to include in the result.

  • Number of entities to skip in the result.

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions?limit=0&skip=0")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions?limit=0&skip=0",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/actions?limit=0&skip=0",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/actions?limit=0&skip=0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions?limit=0&skip=0' \
  --header 'accept: application/json'
Response

Response Body

  • Annotations on this action

  • Details about what the action executes

    • Details about what the action executes

    • Javascript or Swift code to execute when kind is nodejs or swift

    • The actions in the sequence when kind is sequence. The actions are listed in order.

    • Container image name when kind is blackbox

    • Optional zipfile reference when kind is nodejs

    • The type of action

      Possible values: [nodejs:6, nodejs:8, php:7.1, python:3, python-jessie:3, swift:3.1.1, swift:4.1, java, blackbox, sequence]

  • Limits on this action

    • Limits on this action

    • Limits on this action

    • Limits on this action

  • Name of the action

  • Namespace that this action is in

  • Parameter bindings included in the context passed to the action

  • Whether to publish the action or not

  • Semantic version of the action

Status 200

{
  "annotations": "ARRAY",
  "exec": {
    "binary": "BOOLEAN",
    "code": "STRING",
    "components": "STRING",
    "image": "STRING",
    "init": "STRING",
    "kind": "STRING"
  },
  "limits": {
    "logs": "INTEGER",
    "memory": "INTEGER",
    "timeout": "INTEGER"
  },
  "name": "STRING",
  "namespace": "STRING",
  "parameters": "STRING",
  "publish": "BOOLEAN",
  "updated": "INTEGER",
  "version": "STRING"
}

Status 401

{
  "code": "STRING",
  "error": "STRING"
}

Status 403

{
  "code": "STRING",
  "error": "STRING"
}

Status 500

{
  "code": "STRING",
  "error": "STRING"
}

Delete an action

Delete an action.

DELETE
/namespaces/{namespace}/actions/{actionName}
Request

Path Parameters

  • Name of the action

  • Namespace the action is in

Example Request

HttpResponse<String> response = Unirest.delete("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}",
  "method": "DELETE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/actions/{actionName}",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("DELETE", "/api/v1/namespaces/{namespace}/actions/{actionName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request DELETE \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName} \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

No Response Details

This endpoint does not specify any response properties.

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get action information

Get information on a specified action.

GET
/namespaces/{namespace}/actions/{actionName}
Request

Path Parameters

  • The name of the action you want to get information for. To list all actions in a namespace, use the /namespaces/{namespace}/actions call.

  • The namespace that the action is in.

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/actions/{actionName}",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/actions/{actionName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName} \
  --header 'accept: application/json'
Response

Response Body

  • Annotations on this action

  • Details about what the action executes

    • Details about what the action executes

    • Javascript or Swift code to execute when kind is nodejs or swift

    • The actions in the sequence when kind is sequence. The actions are listed in order.

    • Container image name when kind is blackbox

    • Optional zipfile reference when kind is nodejs

    • The type of action

      Possible values: [nodejs:6, nodejs:8, php:7.1, python:3, python-jessie:3, swift:3.1.1, swift:4.1, java, blackbox, sequence]

  • Limits on this action

    • Limits on this action

    • Limits on this action

    • Limits on this action

  • Name of the action

  • Namespace that this action is in

  • Parameter bindings included in the context passed to the action

  • Whether to publish the action or not

  • Semantic version of the action

Status 200

{
  "annotations": "ARRAY",
  "exec": {
    "binary": "BOOLEAN",
    "code": "STRING",
    "components": "STRING",
    "image": "STRING",
    "init": "STRING",
    "kind": "STRING"
  },
  "limits": {
    "logs": "INTEGER",
    "memory": "INTEGER",
    "timeout": "INTEGER"
  },
  "name": "STRING",
  "namespace": "STRING",
  "parameters": "STRING",
  "publish": "BOOLEAN",
  "updated": "INTEGER",
  "version": "STRING"
}

Status 401

{
  "code": "STRING",
  "error": "STRING"
}

Status 404

{
  "code": "STRING",
  "error": "STRING"
}

Status 500

{
  "code": "STRING",
  "error": "STRING"
}

Invoke an action

Invoke an action. Each action results in an activation record.

POST
/namespaces/{namespace}/actions/{actionName}
Request

Path Parameters

  • Name of the action to invoke

  • The namespace the action is in

Query Parameters

  • Blocking or non-blocking invocation. Default is non-blocking.

Request Body

Example Request

HttpResponse<String> response = Unirest.post("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}?blocking=true")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}?blocking=true",
  "method": "POST",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "processData": false
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/actions/{actionName}?blocking=true",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("POST", "/api/v1/namespaces/{namespace}/actions/{actionName}?blocking=true", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}?blocking=true' \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

Response Body

  • ID of this activation

  • Additional details on the action and activation. For a list of activation annotations, see the documentation.

  • Time when the activation completed

  • Logs generated by the activation

  • Name of the action

  • Namespace that the action is in

  • Whether to publish the action or not

  • Details on the response from the action

    • Return value from the activation

    • Exit status of the activation

    • Whether the action was successfully invoked

  • Time when the activation began

  • The user account that activated the item

  • Semantic version of the item

Status 200

{
  "activationId": "STRING",
  "annotations": "ARRAY",
  "duration": "INTEGER",
  "end": "STRING",
  "logs": "ARRAY",
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "response": {
    "result": "OBJECT",
    "status": "STRING",
    "success": "BOOLEAN"
  },
  "start": "STRING",
  "subject": "STRING",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 408

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Create or update an action

Create or update an action, web action, or action sequence.

PUT
/namespaces/{namespace}/actions/{actionName}
Request

Path Parameters

  • Name of the action

  • Namespace the action is in

Query Parameters

  • Overwrite action if it exists. Default is false.

Request Body

  • Annotations on the action. For a list of annotations for web actions, see the documentation.

    • Annotations on the action. For a list of annotations for web actions, see the documentation.

    • Any JSON value

  • Details about what the action executes

    • Details about what the action executes

    • Javascript or Swift code to execute when kind is nodejs or swift

    • The actions in the sequence when kind is sequence. The actions are listed in order.

    • Container image name when kind is blackbox

    • Optional zipfile reference when kind is nodejs

    • The type of action

      Possible values: [nodejs:6, nodejs:8, php:7.1, python:3, python-jessie:3, swift:3.1.1, swift:4.1, java, blackbox, sequence]

  • Limits on this action

    • Limits on this action

    • Limits on this action

    • Limits on this action

  • Parameter bindings included in the context passed to the action

    • Parameter bindings included in the context passed to the action

    • Any JSON value

  • Whether to publish the action or not

  • Semantic version of the action

Example Request

HttpResponse<String> response = Unirest.put("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}?overwrite=true")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .body("{\"annotations\":{\"description\":\"Annotations on the action. For a list of annotations for web actions, see the [documentation](https://console.bluemix.net/docs/openwhisk/openwhisk_annotations.html#annotations-specific-to-web-actions).\",\"items\":{\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"exec\":{\"description\":\"Details about what the action executes\",\"properties\":{\"binary\":true,\"code\":\"string\",\"components\":\"string\",\"image\":\"string\",\"init\":\"string\",\"kind\":\"\\\"nodejs:8\\\"\"},\"type\":\"object\"},\"limits\":{\"description\":\"Limits on this action\",\"properties\":{\"logs\":0,\"memory\":0,\"timeout\":0},\"type\":\"object\"},\"parameters\":{\"description\":\"Parameter bindings included in the context passed to the action\",\"items\":{\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"publish\":true,\"version\":\"string\"}")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}?overwrite=true",
  "method": "PUT",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\"annotations\":{\"description\":\"Annotations on the action. For a list of annotations for web actions, see the [documentation](https://console.bluemix.net/docs/openwhisk/openwhisk_annotations.html#annotations-specific-to-web-actions).\",\"items\":{\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"exec\":{\"description\":\"Details about what the action executes\",\"properties\":{\"binary\":true,\"code\":\"string\",\"components\":\"string\",\"image\":\"string\",\"init\":\"string\",\"kind\":\"\\\"nodejs:8\\\"\"},\"type\":\"object\"},\"limits\":{\"description\":\"Limits on this action\",\"properties\":{\"logs\":0,\"memory\":0,\"timeout\":0},\"type\":\"object\"},\"parameters\":{\"description\":\"Parameter bindings included in the context passed to the action\",\"items\":{\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"publish\":true,\"version\":\"string\"}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/actions/{actionName}?overwrite=true",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ annotations: 
   { description: 'Annotations on the action. For a list of annotations for web actions, see the [documentation](https://console.bluemix.net/docs/openwhisk/openwhisk_annotations.html#annotations-specific-to-web-actions).',
     items: 
      { properties: 
         { key: 'string',
           value: { description: 'Any JSON value', type: 'object' } },
        type: 'object' },
     properties: 
      { key: 'string',
        value: { description: 'Any JSON value', type: 'object' } },
     type: 'object' },
  exec: 
   { description: 'Details about what the action executes',
     properties: 
      { binary: true,
        code: 'string',
        components: 'string',
        image: 'string',
        init: 'string',
        kind: '"nodejs:8"' },
     type: 'object' },
  limits: 
   { description: 'Limits on this action',
     properties: { logs: 0, memory: 0, timeout: 0 },
     type: 'object' },
  parameters: 
   { description: 'Parameter bindings included in the context passed to the action',
     items: 
      { properties: 
         { key: 'string',
           value: { description: 'Any JSON value', type: 'object' } },
        type: 'object' },
     properties: 
      { key: 'string',
        value: { description: 'Any JSON value', type: 'object' } },
     type: 'object' },
  publish: true,
  version: 'string' }));
req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

payload = "{\"annotations\":{\"description\":\"Annotations on the action. For a list of annotations for web actions, see the [documentation](https://console.bluemix.net/docs/openwhisk/openwhisk_annotations.html#annotations-specific-to-web-actions).\",\"items\":{\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"exec\":{\"description\":\"Details about what the action executes\",\"properties\":{\"binary\":true,\"code\":\"string\",\"components\":\"string\",\"image\":\"string\",\"init\":\"string\",\"kind\":\"\\\"nodejs:8\\\"\"},\"type\":\"object\"},\"limits\":{\"description\":\"Limits on this action\",\"properties\":{\"logs\":0,\"memory\":0,\"timeout\":0},\"type\":\"object\"},\"parameters\":{\"description\":\"Parameter bindings included in the context passed to the action\",\"items\":{\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"properties\":{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}},\"type\":\"object\"},\"publish\":true,\"version\":\"string\"}"

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("PUT", "/api/v1/namespaces/{namespace}/actions/{actionName}?overwrite=true", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request PUT \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/actions/{actionName}?overwrite=true' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"annotations":{"description":"Annotations on the action. For a list of annotations for web actions, see the [documentation](https://console.bluemix.net/docs/openwhisk/openwhisk_annotations.html#annotations-specific-to-web-actions).","items":{"properties":{"key":"string","value":{"description":"Any JSON value","type":"object"}},"type":"object"},"properties":{"key":"string","value":{"description":"Any JSON value","type":"object"}},"type":"object"},"exec":{"description":"Details about what the action executes","properties":{"binary":true,"code":"string","components":"string","image":"string","init":"string","kind":"\"nodejs:8\""},"type":"object"},"limits":{"description":"Limits on this action","properties":{"logs":0,"memory":0,"timeout":0},"type":"object"},"parameters":{"description":"Parameter bindings included in the context passed to the action","items":{"properties":{"key":"string","value":{"description":"Any JSON value","type":"object"}},"type":"object"},"properties":{"key":"string","value":{"description":"Any JSON value","type":"object"}},"type":"object"},"publish":true,"version":"string"}'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 400

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 409

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get activation ids

Get activation ids.

GET
/namespaces/{namespace}/activations
Request

Path Parameters

  • The entity namespace

Query Parameters

  • Whether to include full entity description.

  • Number of entities to include in the result.

  • Name of item

  • Only include entities later than this timestamp (measured in milliseconds since Thu, 01 Jan 1970)

  • Number of entities to skip in the result.

  • Only include entities earlier than this timestamp (measured in milliseconds since Thu, 01 Jan 1970)

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations?docs=true&limit=0&name=string&since=0&skip=0&upto=0")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations?docs=true&limit=0&name=string&since=0&skip=0&upto=0",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/activations?docs=true&limit=0&name=string&since=0&skip=0&upto=0",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/activations?docs=true&limit=0&name=string&since=0&skip=0&upto=0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations?docs=true&limit=0&name=string&since=0&skip=0&upto=0' \
  --header 'accept: application/json'
Response

Response Body

  • Name of the item

  • Namespace of the item

  • Whether to publish the item or not

  • Semantic version of the item

Status 200

{
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get activation information

Get activation information.

GET
/namespaces/{namespace}/activations/{activationid}
Request

Path Parameters

  • Name of activation to fetch

  • The entity namespace

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/activations/{activationid}",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/activations/{activationid}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid} \
  --header 'accept: application/json'
Response

Response Body

  • ID of this activation

  • Additional details on the action and activation. For a list of activation annotations, see the documentation.

  • Time when the activation completed

  • Logs generated by the activation

  • Name of the action

  • Namespace that the action is in

  • Whether to publish the action or not

  • Details on the response from the action

    • Return value from the activation

    • Exit status of the activation

    • Whether the action was successfully invoked

  • Time when the activation began

  • The user account that activated the item

  • Semantic version of the item

Status 200

{
  "activationId": "STRING",
  "annotations": "ARRAY",
  "duration": "INTEGER",
  "end": "STRING",
  "logs": "ARRAY",
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "response": {
    "result": "OBJECT",
    "status": "STRING",
    "success": "BOOLEAN"
  },
  "start": "STRING",
  "subject": "STRING",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get the logs for an activation

Get activation logs information.

GET
/namespaces/{namespace}/activations/{activationid}/logs
Request

Path Parameters

  • Name of activation to fetch

  • The entity namespace

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}/logs")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}/logs",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/activations/{activationid}/logs",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/activations/{activationid}/logs", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}/logs \
  --header 'accept: application/json'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get the result of an activation

Get activation result.

GET
/namespaces/{namespace}/activations/{activationid}/result
Request

Path Parameters

  • Name of activation to fetch

  • The entity namespace

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}/result")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}/result",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/activations/{activationid}/result",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/activations/{activationid}/result", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/activations/{activationid}/result \
  --header 'accept: application/json'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get all packages

Get all packages

GET
/namespaces/{namespace}/packages
Request

Path Parameters

  • The entity namespace

Query Parameters

  • Number of entities to include in the result.

  • Include publicly shared entitles in the result.

  • Number of entities to skip in the result.

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages?limit=0&public=true&skip=0")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages?limit=0&public=true&skip=0",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/packages?limit=0&public=true&skip=0",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/packages?limit=0&public=true&skip=0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages?limit=0&public=true&skip=0' \
  --header 'accept: application/json'
Response

Response Body

  • Name of the item

  • Namespace of the item

  • Whether to publish the item or not

  • Semantic version of the item

Status 200

{
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Delete a package

Delete a package

DELETE
/namespaces/{namespace}/packages/{packageName}
Request

Path Parameters

  • The entity namespace

  • Name of package

Example Request

HttpResponse<String> response = Unirest.delete("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName}")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName}",
  "method": "DELETE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/packages/{packageName}",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("DELETE", "/api/v1/namespaces/{namespace}/packages/{packageName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request DELETE \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName} \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

No Response Details

This endpoint does not specify any response properties.

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get package information

Get package information.

GET
/namespaces/{namespace}/packages/{packageName}
Request

Path Parameters

  • The entity namespace

  • Name of package to fetch

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName}")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName}",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/packages/{packageName}",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/packages/{packageName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName} \
  --header 'accept: application/json'
Response

Response Body

  • annotations on the item

    • annotations on the item

    • Any JSON value

    • Name of the item

    • Namespace of the item

  • Name of the item

  • Namespace of the item

  • parameter for the package

    • parameter for the package

    • Any JSON value

  • Whether to publish the item or not

  • Semantic version of the item

Status 200

{
  "annotations": {
    "key": "STRING",
    "value": "OBJECT"
  },
  "binding": {
    "name": "STRING",
    "namespace": "STRING"
  },
  "name": "STRING",
  "namespace": "STRING",
  "parameters": {
    "key": "STRING",
    "value": "OBJECT"
  },
  "publish": "BOOLEAN",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Create or update a package

Create or update a package

PUT
/namespaces/{namespace}/packages/{packageName}
Request

Path Parameters

  • The entity namespace

  • Name of package

Query Parameters

  • Overwrite item if it exists. Default is false.

Request Body

  • annotations on the item

    • annotations on the item

    • Any JSON value

  • Create or update a package

    • Name of the item

    • Namespace of the item

  • parameter for the package

    • parameter for the package

    • Any JSON value

  • Whether to publish the item or not

  • Semantic version of the item

Example Request

HttpResponse<String> response = Unirest.put("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName}?overwrite=string")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .body("{\"annotations\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"binding\":{\"properties\":{\"name\":\"string\",\"namespace\":\"string\"},\"type\":\"object\"},\"parameters\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"publish\":true,\"version\":\"string\"}")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName}?overwrite=string",
  "method": "PUT",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\"annotations\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"binding\":{\"properties\":{\"name\":\"string\",\"namespace\":\"string\"},\"type\":\"object\"},\"parameters\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"publish\":true,\"version\":\"string\"}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/packages/{packageName}?overwrite=string",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ annotations: 
   [ { key: 'string',
       value: { description: 'Any JSON value', type: 'object' } } ],
  binding: 
   { properties: { name: 'string', namespace: 'string' },
     type: 'object' },
  parameters: 
   [ { key: 'string',
       value: { description: 'Any JSON value', type: 'object' } } ],
  publish: true,
  version: 'string' }));
req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

payload = "{\"annotations\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"binding\":{\"properties\":{\"name\":\"string\",\"namespace\":\"string\"},\"type\":\"object\"},\"parameters\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"publish\":true,\"version\":\"string\"}"

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("PUT", "/api/v1/namespaces/{namespace}/packages/{packageName}?overwrite=string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request PUT \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/packages/{packageName}?overwrite=string' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"annotations":[{"key":"string","value":{"description":"Any JSON value","type":"object"}}],"binding":{"properties":{"name":"string","namespace":"string"},"type":"object"},"parameters":[{"key":"string","value":{"description":"Any JSON value","type":"object"}}],"publish":true,"version":"string"}'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 400

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 409

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get all rules

Get all rules

GET
/namespaces/{namespace}/rules
Request

Path Parameters

  • The entity namespace

Query Parameters

  • Number of entities to include in the result.

  • Number of entities to skip in the result.

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules?limit=0&skip=0")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules?limit=0&skip=0",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/rules?limit=0&skip=0",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/rules?limit=0&skip=0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules?limit=0&skip=0' \
  --header 'accept: application/json'
Response

Response Body

  • Name of the item

  • Namespace of the item

  • Whether to publish the item or not

  • Semantic version of the item

Status 200

{
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Delete a rule

Delete a rule

DELETE
/namespaces/{namespace}/rules/{ruleName}
Request

Path Parameters

  • The entity namespace

  • Name of rule to delete

Example Request

HttpResponse<String> response = Unirest.delete("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}",
  "method": "DELETE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/rules/{ruleName}",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("DELETE", "/api/v1/namespaces/{namespace}/rules/{ruleName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request DELETE \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName} \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

No Response Details

This endpoint does not specify any response properties.

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get rule information

Get rule information

GET
/namespaces/{namespace}/rules/{ruleName}
Request

Path Parameters

  • The entity namespace

  • Name of rule to fetch

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/rules/{ruleName}",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/rules/{ruleName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName} \
  --header 'accept: application/json'
Response

Response Body

  • Name of the action

  • Name of the item

  • Namespace of the item

  • Whether to publish the item or not

  • Status of a rule

    Possible values: [active, inactive, activating, deactivating]

  • Name of the trigger

  • Semantic version of the item

Status 200

{
  "action": "STRING",
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "status": "STRING",
  "trigger": "STRING",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Enable or disable a rule

Enable or disable a rule

POST
/namespaces/{namespace}/rules/{ruleName}
Request

Path Parameters

  • The entity namespace

  • Name of rule to update

Query Parameters

  • Set state to enable or disable

Example Request

HttpResponse<String> response = Unirest.post("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}?state=string")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}?state=string",
  "method": "POST",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/rules/{ruleName}?state=string",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("POST", "/api/v1/namespaces/{namespace}/rules/{ruleName}?state=string", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}?state=string' \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 400

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Update a rule

Update a rule

PUT
/namespaces/{namespace}/rules/{ruleName}
Request

Path Parameters

  • The entity namespace

  • Name of rule to update

Query Parameters

  • Overwrite item if it exists. Default is false.

Request Body

  • Name of the action

  • Whether to publish the item or not

  • Name of the trigger

  • Semantic version of the item

Example Request

HttpResponse<String> response = Unirest.put("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}?overwrite=string")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .body("{\"action\":\"string\",\"publish\":true,\"trigger\":\"string\",\"version\":\"string\"}")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}?overwrite=string",
  "method": "PUT",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\"action\":\"string\",\"publish\":true,\"trigger\":\"string\",\"version\":\"string\"}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/rules/{ruleName}?overwrite=string",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ action: 'string',
  publish: true,
  trigger: 'string',
  version: 'string' }));
req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

payload = "{\"action\":\"string\",\"publish\":true,\"trigger\":\"string\",\"version\":\"string\"}"

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("PUT", "/api/v1/namespaces/{namespace}/rules/{ruleName}?overwrite=string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request PUT \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/rules/{ruleName}?overwrite=string' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"action":"string","publish":true,"trigger":"string","version":"string"}'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 400

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 409

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get all triggers

Get all triggers

GET
/namespaces/{namespace}/triggers
Request

Path Parameters

  • The entity namespace

Query Parameters

  • Number of entities to include in the result.

  • Number of entities to skip in the result.

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers?limit=0&skip=0")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers?limit=0&skip=0",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/triggers?limit=0&skip=0",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/triggers?limit=0&skip=0", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers?limit=0&skip=0' \
  --header 'accept: application/json'
Response

Response Body

  • Name of the item

  • Namespace of the item

  • Whether to publish the item or not

  • Semantic version of the item

Status 200

{
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Delete a trigger

Delete a trigger

DELETE
/namespaces/{namespace}/triggers/{triggerName}
Request

Path Parameters

  • The entity namespace

  • Name of trigger to delete

Example Request

HttpResponse<String> response = Unirest.delete("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}",
  "method": "DELETE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/triggers/{triggerName}",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("DELETE", "/api/v1/namespaces/{namespace}/triggers/{triggerName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request DELETE \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName} \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

No Response Details

This endpoint does not specify any response properties.

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Get trigger information

Get trigger information

GET
/namespaces/{namespace}/triggers/{triggerName}
Request

Path Parameters

  • The entity namespace

  • Name of trigger to fetch

Example Request

HttpResponse<String> response = Unirest.get("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}")
  .header("accept", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}",
  "method": "GET",
  "headers": {
    "accept": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/triggers/{triggerName}",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = { 'accept': "application/json" }

conn.request("GET", "/api/v1/namespaces/{namespace}/triggers/{triggerName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request GET \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName} \
  --header 'accept: application/json'
Response

Response Body

  • annotations on the item

    • annotations on the item

    • Any JSON value

  • Name of the item

  • Namespace of the item

  • parameter bindings for the trigger

    • parameter bindings for the trigger

    • Any JSON value

  • Whether to publish the item or not

  • Semantic version of the item

Status 200

{
  "annotations": {
    "key": "STRING",
    "value": "OBJECT"
  },
  "limits": "STRING",
  "name": "STRING",
  "namespace": "STRING",
  "parameters": {
    "key": "STRING",
    "value": "OBJECT"
  },
  "publish": "BOOLEAN",
  "version": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Fire a trigger

Fire a trigger

POST
/namespaces/{namespace}/triggers/{triggerName}
Request

Path Parameters

  • The entity namespace

  • Name of trigger being fired

Request Body

Example Request

HttpResponse<String> response = Unirest.post("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}",
  "method": "POST",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "processData": false
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/triggers/{triggerName}",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("POST", "/api/v1/namespaces/{namespace}/triggers/{triggerName}", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request POST \
  --url https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName} \
  --header 'accept: application/json' \
  --header 'content-type: application/json'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 404

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}

Update a trigger

Update a trigger

PUT
/namespaces/{namespace}/triggers/{triggerName}
Request

Path Parameters

  • The entity namespace

  • Name of trigger to update

Query Parameters

  • Overwrite item if it exists. Default is false.

Request Body

  • annotations on the item

    • annotations on the item

    • Any JSON value

  • Update a trigger

  • parameter bindings included in the context passed to the trigger

    • parameter bindings included in the context passed to the trigger

    • Any JSON value

  • Whether to publish the item or not

  • Semantic version of the item

Example Request

HttpResponse<String> response = Unirest.put("https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}?overwrite=string")
  .header("accept", "application/json")
  .header("content-type", "application/json")
  .body("{\"annotations\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"limits\":\"string\",\"parameters\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"publish\":true,\"version\":\"string\"}")
  .asString();
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}?overwrite=string",
  "method": "PUT",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\"annotations\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"limits\":\"string\",\"parameters\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"publish\":true,\"version\":\"string\"}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "openwhisk.ng.bluemix.net",
  "port": null,
  "path": "/api/v1/namespaces/{namespace}/triggers/{triggerName}?overwrite=string",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ annotations: 
   [ { key: 'string',
       value: { description: 'Any JSON value', type: 'object' } } ],
  limits: 'string',
  parameters: 
   [ { key: 'string',
       value: { description: 'Any JSON value', type: 'object' } } ],
  publish: true,
  version: 'string' }));
req.end();
import http.client

conn = http.client.HTTPSConnection("openwhisk.ng.bluemix.net")

payload = "{\"annotations\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"limits\":\"string\",\"parameters\":[{\"key\":\"string\",\"value\":{\"description\":\"Any JSON value\",\"type\":\"object\"}}],\"publish\":true,\"version\":\"string\"}"

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("PUT", "/api/v1/namespaces/{namespace}/triggers/{triggerName}?overwrite=string", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
curl --request PUT \
  --url 'https://openwhisk.ng.bluemix.net/api/v1/namespaces/{namespace}/triggers/{triggerName}?overwrite=string' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"annotations":[{"key":"string","value":{"description":"Any JSON value","type":"object"}}],"limits":"string","parameters":[{"key":"string","value":{"description":"Any JSON value","type":"object"}}],"publish":true,"version":"string"}'
Response

Response Body

Status 200

{
  "undefined": "undefined"
}

Status 400

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 401

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 409

{
  "code": "INTEGER",
  "error": "STRING"
}

Status 500

{
  "code": "INTEGER",
  "error": "STRING"
}