NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

ONTAP Rest API Discussions

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

SCL
2,273 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
2,211 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
2,212 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
2,187 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