#REST/API access before cluster initialization

1 messages · Page 1 of 1 (latest)

sharp palm
#

Hello all,

We have developed a script that automates the creation of a cluster without human intervention based on ZAPIs.

We would like to migrate this script to REST/API, however before launching the cluster creation, we need to retrieve the LLDP information from ONTAP to configure our network equipment.

The API returns this error:

{ "error": { "message": "Only POST/OPTIONS on /api/cluster, GET/HEAD/OPTIONS on /api/cluster/nodes, or calls on /api/cluster/jobs are available in precluster.", "code": "9241607" } }

Is there a way to get this information even when the cluster is not yet configured?
Any idea why REST API is more restrictive than ZAPIs?

simple ruin
#

Try this API:

https://$node_mgmt_IP_or_DNS/api/cluster/nodes?order_by=name&fields=cluster_interfaces,controller,date,ha,location,management_interfaces,membership,metrocluster,model,name,nvram,owner,serial_number,service_processor,state,storage_configuration,system_id,system_machine_type,uptime,uuid,vendor_serial_number,version,_links,vm,is_all_flash_optimized,,external_cache&return_timeout=120
sharp palm
#

I tested, unfortunately the API route return does not contain the information I am looking for.

Here is the ZAPI call that works in any node/cluster state:

curl -k -u $user:$pass -d '<?xml version="1.0" encoding="UTF-8"?> <netapp xmlns="http://www.netapp.com/filer/admin" version="1.30"> <net-device-discovery-get-iter/> </netapp>' -H "Content-Type: text/xml" -X POST https://$host/servlets/netapp.servlets.admin.XMLrequest_filer | xmllint --format - 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE netapp SYSTEM "file:/etc/netapp_gx.dtd">
<netapp xmlns="http://www.netapp.com/filer/admin" version="1.251">
  <results status="passed">
    <attributes-list>
      <net-device-discovery-info>
        <capabilities>
          <device-capability>router</device-capability>
          <device-capability>trans_bridge</device-capability>
        </capabilities>
....

The equivalent with REST API would be https://$node_mgmt_IP_or_DNS/api/network/ethernet/ports?fields=discovered_devices but before cluster initialization I'm not allowed to do it.