3

I'm having a lot of trouble with passing the required parameters to a Juju Action. This is the contents of my actions.yaml:

create-root-cert:
  description: "Generate a Root CA Certificate"
  params:
    subject:
      type: object
      description: "Relative Distinguished Names (RDNs)"
      properties:
        cn:
          type: string
          description: "Common Name"
  required: [subject.cn]

However when I run:

juju action do strongswan/0 create-root-cert subject.cn="beenswerving.com"

I get the following error:

ERROR validation failed: (root) : "subject.cn" property is missing and required, given {"subject":{"cn":"beenswerving.com"}}

I'm running:

jammin@ADARA:$ juju version
1.24-alpha1-trusty-amd64
benileo
  • 175
  • 6

1 Answers1

4

The 'required' key is a peer to the 'properties' key. When your schema contains an object it gets it's own properties and required keys (among the others). You can update your actions.yaml like this and it should work:

create-root-cert:
  description: "Generate a Root CA Certificate"
  params:
    subject:
      type: object
      description: "Relative Distinguished Names (RDNs)"
      properties:
        cn:
          type: string
          description: "Common Name"
      required: [cn]

Notice 'required' is indented and the required field name is local, rather than scoped under 'subject'