cloudera / cm_api

Cloudera Manager API Client
Apache License 2.0
307 stars 284 forks source link

Even more broken documentation #20

Open aragnon opened 10 years ago

aragnon commented 10 years ago

The documentation for create_cluster does not state any failure conditions. Hence, it's broken. Can you please release something which works according to what is documented?

The instructions to call getNextException are also useless, because it doesn't refer to any particular module and the global symbol getNextException doesn't exist. I don't quite understand what moves you to write such shitty documentation and code.

The current documentation for create_cluster for the version argument is also completely wrong; it says one layer down that you can pass it for example "4", except that too is a lie. You can only pass it something like "CDH4" (this is also on your "blog"). So, basically every single API call I find is either broken in its documentation or in its code. How exactly do you expect people to use this?

$ python create_cluster.py 
Traceback (most recent call last):
  File "create_cluster.py", line 18, in <module>
    cluster = api.create_cluster(CLUSTERNAME, "CDH"+str(CDH_VERSION))
  File "/data/home/cloudera-api-caller/development/env/lib/python2.7/site-packages/cm_api/api_client.py", line 108, in create_cluster
    return clusters.create_cluster(self, name, version)
  File "/data/home/cloudera-api-caller/development/env/lib/python2.7/site-packages/cm_api/endpoints/clusters.py", line 45, in create_cluster
    data=[apicluster], api_version=api_version)[0]
  File "/data/home/cloudera-api-caller/development/env/lib/python2.7/site-packages/cm_api/endpoints/types.py", line 137, in call
    ret = method(path, data=data, params=params)
  File "/data/home/cloudera-api-caller/development/env/lib/python2.7/site-packages/cm_api/resource.py", line 138, in post
    self._make_headers(contenttype))
  File "/data/home/cloudera-api-caller/development/env/lib/python2.7/site-packages/cm_api/resource.py", line 63, in invoke
    headers=headers)
  File "/data/home/cloudera-api-caller/development/env/lib/python2.7/site-packages/cm_api/http_client.py", line 161, in execute
    raise self._exc_class(ex)
cm_api.api_client.ApiException: Batch entry 0 insert into CLUSTERS (OPTIMISTIC_LOCK_VERSION, NAME, VERSION, MAINTENANCE_COUNT, CLUSTER_ID) values ('0', 'Cluster 1 - CDH4', '4', '0', '4') was aborted.  Call getNextException to see the cause. (error 400)
sorabhj commented 7 years ago

i am also facing same issues , can someone please help in resolving this ?

darey-io commented 6 years ago

Can someone please respond to this issue and provide a direction? I am trying to use this API for my deployment, but the documentation isnt very helpful.