Skip to content

Annotations for sequences require unwieldy workarounds #168

@trieloff

Description

@trieloff

The intuitive way of adding annotation to a sequence is this:

openwhisk.actions.update({
  annotations: { "web-export": true, "raw-http": false },
  name: "mysequence",
  action: { exec: { kind: "sequence", components: ["/myuser/someaction"] } }
});

but the implementation of the client currently assumes that passing an options.action object means that the developer intends to build the whole request body themselves, which means the required call would be:

openwhisk.actions.update({
  name: "mysequence",
  action: {
    namespace: "myuser",
    name: "mysequence",
    exec: {
      kind: "sequence",
      components: ["/myuser/someaction"]
    },
    annotations: [
      {
        key: "exec",
        value: "sequence"
      },
      {
        key: "web-export",
        value: true
      },
      {
        key: "raw-http",
        value: false
      },
      {
        key: "final",
        value: true
      }
    ]
  }
});

While this might not be strictly a bug, it is clearly inconvenient and hard to get right without some assistance from @jthomas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions