ONTAP Rest API Discussions

how to use multiple key-value pairs in body of na_ontap_rest_api?

SCL
1,046 Views

I have this functioning example of na_ontap_rest_api:

- name: run vserver cifs security modify aes-enabled-for-netlogon-channel true
  netapp.ontap.na_ontap_rest_cli:
    hostname: "{{ inventory_hostname }}"
    username: "{{ lookup('env','NETAPP_USER') }}"
    password: "{{ lookup('env','NETAPP_PASS') }}"
    validate_certs: false
    command: 'vserver/cifs/security'
    verb: PATCH
    params: { 'vserver': "{{ item.name }}" }
    body: { 'aes-enabled-for-netlogon-channel': 'true' }
  with_items:
    - "{{ svm }}"
  register: command_result
  tags: [standard,command,cifs-security,new]

I want to do something similar with this CLI:

ldap client modify -vserver <vserver> -client-config exoduspoint_ad -ldaps-enabled true -port 636

What is the format for using multiple key-value pairs in the body? -- TIA!

1 ACCEPTED SOLUTION

JohnChampion
984 Views

It's a standard JSON body so I would imagine this would work...

 

body: { "client-config": "exoduspoint_ad", "ldaps-enabled": true, "port": "636" }

View solution in original post

2 REPLIES 2

JohnChampion
985 Views

It's a standard JSON body so I would imagine this would work...

 

body: { "client-config": "exoduspoint_ad", "ldaps-enabled": true, "port": "636" }

SCL
960 Views

Thanks @JohnChampion -- a comma-separated list worked but we cleaned it up a bit by doing this (different bloc snippet)

 

    params: { 'vserver': "{{ item.name }}" }
    body:
      advertised-enc-types: ['aes-128','aes-256']
      aes-enabled-for-netlogon-channel: true
      is-signing-required: true
      lm-compatibility-level: ntlmv2-krb
      session-security-for-ad-ldap: seal
Public