diff options
author | Andrey Pavlov <apavlov@mirantis.com> | 2015-11-12 19:20:02 +0300 |
---|---|---|
committer | Andrey Pavlov <apavlov@mirantis.com> | 2015-11-12 19:20:02 +0300 |
commit | 8a5a16f1d6cde1fe22b5bc58ee4ea34d0f8faf72 (patch) | |
tree | e2c4fa6150d48bde1d58640b40558e63e12c95b3 /doc | |
parent | 1aaea83b02eeaf7a8da6a89da1cbb7b2396bf191 (diff) | |
download | python-saharaclient-8a5a16f1d6cde1fe22b5bc58ee4ea34d0f8faf72.tar.gz |
Adding autogenerated saharaclient API docs
Saharaclient API docs now can be autogenerated, that
prevents them from manual update. Also docstrings
were added to describe some unclear parameters.
Change-Id: Ibf9fdf332c91cdfb18d6f8ec5429a39dc2862494
Diffstat (limited to 'doc')
-rw-r--r-- | doc/source/api.rst | 103 |
1 files changed, 47 insertions, 56 deletions
diff --git a/doc/source/api.rst b/doc/source/api.rst index b6487de..10f0838 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -4,33 +4,26 @@ Sahara Client Overview -------- -Sahara Client provides a list of Python interfaces to communicate with the Sahara REST API. -Sahara Client enables users to perform most of the existing operations like retrieving template lists, -creating Clusters, submitting EDP Jobs, etc. +Sahara Client provides a list of Python interfaces to communicate with the +Sahara REST API. Sahara Client enables users to perform most of the existing +operations like retrieving template lists, creating Clusters, submitting EDP +Jobs, etc. Instantiating a Client ---------------------- -To start using the Sahara Client users have to create an instance of the `Client` class. -The client constructor has a list of parameters to authenticate and locate Sahara endpoint. - - * auth_url - Keystone URL that will be used for authentication. - * sahara_url - Sahara REST API URL to communicate with. - * service_type - Sahara service name in Keystone catalog. (Default: data-processing) - * endpoint_type - Desired Sahara endpoint type. (Default: publicURL) - * username - Username for Keystone authentication. - * api_key - Password for Keystone authentication. - * project_name - Keystone Tenant name. - * project_id - Keystone Tenant id. - * input_auth_token - Keystone authorization token. - * insecure - Allow insecure. - * auth - Keystone Authentication Plugin object. - * session - Keystone Session object. +To start using the Sahara Client users have to create an instance of the +`Client` class. The client constructor has a list of parameters to authenticate +and locate Sahara endpoint. + +.. autoclass:: saharaclient.api.client.Client + :members: **Important!** - It is not a mandatory rule to provide all of the parameters above. The minimum number should be enough - to determine Sahara endpoint, check user authentication and tenant to operate in. + It is not a mandatory rule to provide all of the parameters above. The minimum + number should be enough to determine Sahara endpoint, check user + authentication and tenant to operate in. Authentication check ~~~~~~~~~~~~~~~~~~~~ @@ -61,9 +54,10 @@ For more information about Keystone Sessions, see `Using Sessions`_. Sahara endpoint discovery ~~~~~~~~~~~~~~~~~~~~~~~~~ -If user has a direct URL pointing to Sahara REST API, it may be specified as `sahara_url`. -If this parameter is missing, Sahara client will use Keystone Service Catalog to find the endpoint. -There are two parameters: `service_type` and `endpoint_type` to configure endpoint search. Both parameters have +If user has a direct URL pointing to Sahara REST API, it may be specified as +`sahara_url`. If this parameter is missing, Sahara client will use Keystone +Service Catalog to find the endpoint. There are two parameters: `service_type` +and `endpoint_type` to configure endpoint search. Both parameters have default values. .. sourcecode:: python @@ -99,78 +93,75 @@ Sahara Client has a list of fields to operate with: * job_executions * job_types -Each of this fields is a reference to a Manager for a corresponding group of REST calls. +Each of this fields is a reference to a Manager for a corresponding group of +REST calls. Supported operations -------------------- -The following methods are allowed for all Managers: - - * list() - Get a list of all objects of specified type. - * get(id) - Get an object by id. (In case of plugins, the Plugin name should be provided) - * delete(id) - Delete an object by id. (Available only for templates and EDP objects) - -Plugin Manager ops -~~~~~~~~~~~~~~~~~~ +Plugin ops +~~~~~~~~~~ - * get_version_details(plugin_name, hadoop_version) - Get the list of Services and Service Parameters for a specified Plugin and Hadoop Version - * convert_to_cluster_template(plugin_name, hadoop_version, template_name, filecontent) - This call is used to create Cluster Templates directly, avoiding Cluster Template mechanism. +.. autoclass:: saharaclient.api.plugins.PluginManager + :members: Image Registry ops ~~~~~~~~~~~~~~~~~~ - * update_image(image_id, user_name, descr) - Create or update an Image in Image Registry. - * unregister_image(image_id) - Remove an Image from Sahara Image Registry. - * update_tags(image_id, new_tags) - Updates Image tags. `new_tags` list will replace currently assigned tags. +.. autoclass:: saharaclient.api.images.ImageManager + :members: Node Group Template ops ~~~~~~~~~~~~~~~~~~~~~~~ - * create(name, plugin_name, hadoop_version, flavor_id, description, volumes_per_node, volumes_size, node_processes, node_configs, floating_ip_pool, security_groups, auto_security_group, availability_zone, volumes_availability_zone, volume_type, image_id, is_proxy_gateway, volume_local_to_instance, use_autoconfig, shares, is_public, is_protected) - Create a Node Group Template with specified parameters. - * update(ng_template_id, name, plugin_name, hadoop_version, flavor_id, description, volumes_per_node, volumes_size, node_processes, node_configs, floating_ip_pool, security_groups, auto_security_group, availability_zone, volumes_availability_zone, volume_type, image_id, is_proxy_gateway, volume_local_to_instance, use_autoconfig, shares, is_public, is_protected) - Update a Node Group Template with specified parameters. +.. autoclass:: saharaclient.api.node_group_templates.NodeGroupTemplateManager + :members: Cluster Template ops ~~~~~~~~~~~~~~~~~~~~ - * create(name, plugin_name, hadoop_version, description, cluster_configs, node_groups, anti_affinity, net_id, default_image_id, use_autoconfig, shares, is_public, is_protected) - Create a Cluster Template with specified parameters. - * update(cluster_template_id, name, plugin_name, hadoop_version, description, cluster_configs, node_groups, anti_affinity, net_id, default_image_id, use_autoconfig, shares, is_public, is_protected) - Update a Cluster Template with specified parameters. +.. autoclass:: saharaclient.api.cluster_templates.ClusterTemplateManager + :members: Cluster ops ~~~~~~~~~~~ - * create(name, plugin_name, hadoop_version, cluster_template_id, default_image_id, is_transient, description, cluster_configs, node_groups, user_keypair_id, anti_affinity, net_id, count, use_autoconfig, shares, is_public, is_protected) - Launch a Cluster with specified parameters. - * scale(cluster_id, scale_object) - Scale an existing Cluster. `scale_object` format is described in REST API doc. - * update(cluster_id, name, description, is_public, is_protected) - Update a Cluster with specified parameters. +.. autoclass:: saharaclient.api.clusters.ClusterManager + :members: Data Source ops ~~~~~~~~~~~~~~~ - * create(name, description, data_source_type, url, credential_user, credential_pass, is_public, is_protected) - Create a Data Source with specified parameters. - * update(data_source_id, update_data) - Update a Data Source with provided `data`. +.. autoclass:: saharaclient.api.data_sources.DataSourceManager + :members: Job Binary Internal ops ~~~~~~~~~~~~~~~~~~~~~~~ - * create(name, data) - Create a Job Binary Internal from provided `data`. - * update(job_binary_id, name, is_public, is_protected) - Update a Job Binary Internal with specified parameters +.. autoclass:: saharaclient.api.job_binary_internals.JobBinaryInternalsManager + :members: create, update Job Binary ops ~~~~~~~~~~~~~~ - * create(name, url, description, extra, is_public, is_protected) - Create a Job Binary with specified parameters. - * get_file(job_binary_id) - Download a Job Binary. - * update(job_binary_id, data) - Update Job Binary with provided `data`. +.. autoclass:: saharaclient.api.job_binaries.JobBinariesManager + :members: Job ops ~~~~~~~ - * create(name, type, mains, libs, description, interface, is_public, is_protected) - Create a Job with specified parameters. - * get_configs(job_type) - Get config hints for a specified Job type. - * update(job_id, name, description, is_public, is_protected) - Update a Job with specified parameters. +.. autoclass:: saharaclient.api.jobs.JobsManager + :members: Job Execution ops ~~~~~~~~~~~~~~~~~ - * create(job_id, cluster_id, input_id, output_id, configs, interface, is_public, is_protected) - Launch a Job with specified parameters. - * update(obj_id, is_public, is_protected) - Update a Job Execution with specified parameters. +.. autoclass:: saharaclient.api.job_executions.JobExecutionsManager + :members: + +Job Types ops +~~~~~~~~~~~~~ + +.. autoclass:: saharaclient.api.job_types.JobTypesManager + :members: |