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 ibmcloud 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/api/v1

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, web actions, and action sequences in a namespace.

GET
/namespaces/{namespace}/actions
Request

Path Parameters

  • Namespace that the action is in.

Query Parameters

  • Number of actions to include in the result.

  • Number of actions 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 entity

  • Details about what the entity executes

    • Details about what the entity 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 entity

      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 entity

    • Limits on this entity

    • Limits on this entity

    • Limits on this entity

  • Name of the entity

  • Namespace that this entity is in

  • Parameter bindings included in the context passed to the entity

  • Whether to publish the entity or not

  • Last-updated Unix epoch timestamp

  • Semantic version of the entity

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, web action, or action sequence.

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

Path Parameters

  • Name of the entity.

  • Namespace that the entity 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, web action, or action sequence.

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

Path Parameters

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

  • Namespace that the entity 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 entity

  • Details about what the entity executes

    • Details about what the entity 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 entity

      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 entity

    • Limits on this entity

    • Limits on this entity

    • Limits on this entity

  • Name of the entity

  • Namespace that this entity is in

  • Parameter bindings included in the context passed to the entity

  • Whether to publish the entity or not

  • Last-updated Unix epoch timestamp

  • Semantic version of the entity

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, web action, or action sequence. Each invocation results in an activation record.

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

Path Parameters

  • Name of the entity to invoke.

  • Namespace that the entity 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

  • For a list of activation annotations, see the documentation.

  • Time, in milliseconds, that it took for the activation to complete

  • Time when the activation completed

  • Logs generated by the activation

  • Name of the entity

  • Namespace that the entity is in

  • Whether to publish the entity or not

  • Details on the response from the entity

    • 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 entity.

  • Namespace that the entity is in.

Query Parameters

  • Enter true to overwrite the entity if it exists. The default is false.

Request Body

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

    • The key value

    • Any JSON value

  • Details about what the entity executes

    • Details about what the entity 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 entity

      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 entity

    • Limits on this entity

    • Limits on this entity

    • Limits on this entity

  • Parameter bindings included in the context passed to the entity

    • The key value

    • Any JSON value

  • Whether to publish the entity or not

  • Semantic version of the entity

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 entity. 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 entity executes\",\"properties\":{\"binary\":true,\"code\":\"string\",\"components\":\"string\",\"image\":\"string\",\"init\":\"string\",\"kind\":\"\\\"nodejs:8\\\"\"},\"type\":\"object\"},\"limits\":{\"description\":\"Limits on this entity\",\"properties\":{\"logs\":0,\"memory\":0,\"timeout\":0},\"type\":\"object\"},\"parameters\":{\"description\":\"Parameter bindings included in the context passed to the entity\",\"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 entity. 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 entity executes\",\"properties\":{\"binary\":true,\"code\":\"string\",\"components\":\"string\",\"image\":\"string\",\"init\":\"string\",\"kind\":\"\\\"nodejs:8\\\"\"},\"type\":\"object\"},\"limits\":{\"description\":\"Limits on this entity\",\"properties\":{\"logs\":0,\"memory\":0,\"timeout\":0},\"type\":\"object\"},\"parameters\":{\"description\":\"Parameter bindings included in the context passed to the entity\",\"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 entity. 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 entity executes',
     properties: 
      { binary: true,
        code: 'string',
        components: 'string',
        image: 'string',
        init: 'string',
        kind: '"nodejs:8"' },
     type: 'object' },
  limits: 
   { description: 'Limits on this entity',
     properties: { logs: 0, memory: 0, timeout: 0 },
     type: 'object' },
  parameters: 
   { description: 'Parameter bindings included in the context passed to the entity',
     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 entity. 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 entity executes\",\"properties\":{\"binary\":true,\"code\":\"string\",\"components\":\"string\",\"image\":\"string\",\"init\":\"string\",\"kind\":\"\\\"nodejs:8\\\"\"},\"type\":\"object\"},\"limits\":{\"description\":\"Limits on this entity\",\"properties\":{\"logs\":0,\"memory\":0,\"timeout\":0},\"type\":\"object\"},\"parameters\":{\"description\":\"Parameter bindings included in the context passed to the entity\",\"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 entity. 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 entity executes","properties":{"binary":true,"code":"string","components":"string","image":"string","init":"string","kind":"\"nodejs:8\""},"type":"object"},"limits":{"description":"Limits on this entity","properties":{"logs":0,"memory":0,"timeout":0},"type":"object"},"parameters":{"description":"Parameter bindings included in the context passed to the entity","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

  • The activation record ID for the action invocation.

Status 200

{
  "activationId": "STRING"
}

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 information about activation records that result from action invocations.

GET
/namespaces/{namespace}/activations
Request

Path Parameters

  • Namespace that you want to see activation records for.

Query Parameters

  • Whether to include the full description for each activation record.

  • Number of records to include in the result.

  • To see activation records for only one entity, enter the entity name.

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

  • Number of records to skip in the result.

  • Only include records 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

  • The ID of the activation record

  • For a list of activation annotations, see the documentation.

  • Time, in milliseconds, that it took for the activation to complete

  • Time when the activation completed

  • Name of the entity

  • Namespace that the entity is in

  • Whether to publish the entity or not

  • Time when the activation began

  • The status code returned by the entity

  • Semantic version of the item

Status 200

{
  "activationId": "STRING",
  "annotations": "ARRAY",
  "duration": "INTEGER",
  "end": "STRING",
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "start": "STRING",
  "statusCode": "STRING",
  "version": "STRING"
}

Status 401

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

Status 500

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

Get activation information

Get information about an activation record that resulted from an action invocation.

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

Path Parameters

  • Activation record ID. To see all activation record IDs for a namespace, use the GET /namespaces/{namespace}/activations call.

  • Namespace that the entity is in.

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

  • For a list of activation annotations, see the documentation.

  • Time, in milliseconds, that it took for the activation to complete

  • Time when the activation completed

  • Logs generated by the activation

  • Name of the entity

  • Namespace that the entity is in

  • Whether to publish the entity or not

  • Details on the response from the entity

    • 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 activation logs

Get the logs for an activation.

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

Path Parameters

  • ID of the activation record

  • Namespace that the entity is in

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

  • Logs for the activation.

Status 200

{
  "logs": "ARRAY"
}

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 the results of an activation.

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

Path Parameters

  • ID for the activation record

  • Namespace that the entity is in

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

  • Return value from the activation

  • Exit status of the activation

  • Whether the action was successfully invoked

Status 200

{
  "result": "OBJECT",
  "status": "STRING",
  "success": "BOOLEAN"
}

Status 401

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

Status 404

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

Status 500

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

Get all packages

List all packages in a namespace. Packages are bundles of related actions and feeds. Pre-installed packages are available in the /whisk.system namespace. For more information, see the Cloud Functions packages documentation.

GET
/namespaces/{namespace}/packages
Request

Path Parameters

  • Namespace that the package is in.

Query Parameters

  • Number of packages to include in the result.

  • Include publicly shared packages in the result.

  • Number of packages 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

  • Annotations on this package, such as a package description and parameters

  • Whether the package has a binding

  • Name of the package

  • Namespace that the package is in

  • Whether the package is publically published

  • Last-updated Unix epoch timestamp

  • Semantic version of the package

Status 200

{
  "annotations": "ARRAY",
  "binding": "BOOLEAN",
  "name": "STRING",
  "namespace": "STRING",
  "publish": "STRING",
  "updated": "INTEGER",
  "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

  • Namespace that the package is in

  • Name of the 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 information on a specified package.

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

Path Parameters

  • Namespace that the package is in

  • Name of the package

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 this package, such as a package description and parameters

  • Whether the package has a binding

  • Name of the package

  • Namespace that the package is in

  • Whether the package is publically published

  • Last-updated Unix epoch timestamp

  • Semantic version of the package

Status 200

{
  "annotations": "ARRAY",
  "binding": "BOOLEAN",
  "name": "STRING",
  "namespace": "STRING",
  "publish": "STRING",
  "updated": "INTEGER",
  "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. This can include optionally creating a package binding or setting default package-level parameters.

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

Path Parameters

  • Namespace that the package is in

  • Name of the package

Query Parameters

  • Enter true to overwrite the entity if it exists. The default is false.

Request Body

  • Annotations on the package, such as a description

    • The key value

    • Any JSON value

  • Create a binding for the package. A binding specifies a parituclar set of values to be automatically passed to any actions in the package.

    • Name of the package binding

    • Namespace that the package binding is in

  • Set default parameters that are inherited by all actions in the package.

    • The key value

    • Any JSON value

  • Whether to publicly publish the package

  • Semantic version of the package

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\":{\"description\":\"Create a binding for the package. A [binding](https://console.bluemix.net/docs/openwhisk/openwhisk_packages.html#openwhisk_package_bind) specifies a parituclar set of values to be automatically passed to any actions in the package.\",\"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\":{\"description\":\"Create a binding for the package. A [binding](https://console.bluemix.net/docs/openwhisk/openwhisk_packages.html#openwhisk_package_bind) specifies a parituclar set of values to be automatically passed to any actions in the package.\",\"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: 
   { description: 'Create a binding for the package. A [binding](https://console.bluemix.net/docs/openwhisk/openwhisk_packages.html#openwhisk_package_bind) specifies a parituclar set of values to be automatically passed to any actions in the package.',
     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\":{\"description\":\"Create a binding for the package. A [binding](https://console.bluemix.net/docs/openwhisk/openwhisk_packages.html#openwhisk_package_bind) specifies a parituclar set of values to be automatically passed to any actions in the package.\",\"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":{"description":"Create a binding for the package. A [binding](https://console.bluemix.net/docs/openwhisk/openwhisk_packages.html#openwhisk_package_bind) specifies a parituclar set of values to be automatically passed to any actions in the package.","properties":{"name":"string","namespace":"string"},"type":"object"},"parameters":[{"key":"string","value":{"description":"Any JSON value","type":"object"}}],"publish":true,"version":"string"}'
Response

Response Body

  • The activation record ID for the action invocation.

Status 200

{
  "activationId": "STRING"
}

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

List all rules in a namespace. A rule associates a trigger with an action. Every time the trigger fires, the rule invokes the associated action. For more information, see the Cloud Functions rules documentation.

GET
/namespaces/{namespace}/rules
Request

Path Parameters

  • Namespace that the rule is in

Query Parameters

  • Number of rules to include in the result

  • Number of rules 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 associated action

  • Annotations on the rule

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

  • Name of the rule

  • Namespace that the rule is in

  • Whether the rule is publicly published

  • Whether the rule is actively enabled

  • Name of the associated trigger

  • Semantic version of the item

Status 200

{
  "action": "STRING",
  "annotations": "STRING",
  "name": "STRING",
  "namespace": "STRING",
  "publish": "BOOLEAN",
  "status": "STRING",
  "trigger": "STRING",
  "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

  • Namespace that the rule is in

  • Name of the 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 information on a specified rule.

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

Path Parameters

  • Namespace that the rule is in

  • Name of the rule

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 associated action

  • Annotations on the rule

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

  • Name of the rule

  • Namespace that the rule is in

  • Whether the rule is publicly published

  • Whether the rule is actively enabled

  • Name of the associated trigger

  • Semantic version of the item

Status 200

{
  "action": "STRING",
  "annotations": "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

  • Namespace that the rule is in

  • Name of the rule to enable or disable

Query Parameters

  • Set 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

  • The activation record ID for the action invocation.

Status 200

{
  "activationId": "STRING"
}

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

  • Namespace that the rule is in

  • Name of the rule to update

Query Parameters

  • Set to true to overwrite any existing rule with this name. Default is false.

Request Body

  • Name of the action to associate with the rule

  • Whether to publicly publish the rule

  • Name of the trigger to associate with the rule

  • Semantic version of the rule

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

  • The activation record ID for the action invocation.

Status 200

{
  "activationId": "STRING"
}

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

List all triggers in a namespace. Triggers are a named channel for a class of events. A trigger is a declaration that you want to react to a certain type of event, whether from a user or by an event source. For more information, see the Cloud Functions triggers documentation.

GET
/namespaces/{namespace}/triggers
Request

Path Parameters

  • Namespace that the trigger is in

Query Parameters

  • Number of triggers to include in the result

  • Number of triggers 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

  • Annotations on the trigger

    • The key value

    • Any JSON value

  • Name of the trigger

  • Namespace that the trigger is in

  • Parameter bindings for the trigger

    • The key value

    • Any JSON value

  • Whether the trigger is publicly published

  • Associated rules and actions

  • Last-updated Unix epoch timestamp

  • Semantic version of the trigger

Status 200

{
  "annotations": {
    "key": "STRING",
    "value": "OBJECT"
  },
  "limits": "STRING",
  "name": "STRING",
  "namespace": "STRING",
  "parameters": {
    "key": "STRING",
    "value": "OBJECT"
  },
  "publish": "BOOLEAN",
  "rules": "ARRAY",
  "updated": "STRING",
  "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 namespace that the trigger is in

  • Name of the 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 information on a specified trigger.

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

Path Parameters

  • The namespace that the trigger is in

  • Name of the trigger

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 trigger

    • The key value

    • Any JSON value

  • Name of the trigger

  • Namespace that the trigger is in

  • Parameter bindings for the trigger

    • The key value

    • Any JSON value

  • Whether the trigger is publicly published

  • Associated rules and actions

  • Last-updated Unix epoch timestamp

  • Semantic version of the trigger

Status 200

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

Status 401

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

Status 404

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

Status 500

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

Fire a trigger

Manually fire a trigger. If the trigger is associated with a rule, the rule will invoke the associated action.

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

Path Parameters

  • Namespace that the trigger is in

  • Name of the trigger to fire

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

  • The activation record ID for the action invocation.

Status 200

{
  "activationId": "STRING"
}

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

  • Namespace that the trigger is in

  • Name of the trigger to update

Query Parameters

  • Set to true to overwrite any existing trigger with this name. Default is false.

Request Body

  • Annotations on the trigger

    • The key value

    • Any JSON value

  • Update a trigger.

  • Parameter bindings for the trigger

    • The key value

    • Any JSON value

  • Whether to publicly publish the trigger

  • Semantic version of the trigger

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

  • The activation record ID for the action invocation.

Status 200

{
  "activationId": "STRING"
}

Status 400

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

Status 401

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

Status 409

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

Status 500

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