.\" Man page generated from reStructuredText. . .TH "SAHARACLIENT" "1" "April 18, 2014" "0.7.0" "Sahara Client" .SH NAME saharaclient \- Sahara Client . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .sp This is a client for OpenStack Sahara API. There\(aqs \fBa Python API\fP (the \fBsaharaclient\fP module), and a \fBcommand\-line script\fP (installed as \fBsahara\fP). Each implements the entire OpenStack Sahara API. .sp You\(aqll need credentials for an OpenStack cloud that implements the Data Processing API, in order to use the sahara client. .sp You may want to read the \fI\%OpenStack Sahara Docs\fP \-\- the overview, at least \-\- to get an idea of the concepts. By understanding the concepts this library should make more sense. .INDENT 0.0 .INDENT 3.5 .UNINDENT .UNINDENT .sp Contents: .SH SAHARA CLIENT .SS Overview .sp 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. .SS Instantiating a Client .sp To start using the Sahara Client users have to create an instance of the \fIClient\fP class. The client constructor has a list of parameters to authenticate and locate Sahara endpoint. .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 auth_url \- Keystone URL that will be used for authentication. .IP \(bu 2 sahara_url \- Sahara REST API URL to communicate with. .IP \(bu 2 service_type \- Sahara service name in Keystone catalog. (Default: data_processing) .IP \(bu 2 endpoint_type \- Desired Sahara endpoint type. (Default: publicURL) .IP \(bu 2 username \- Username for Keystone authentication. .IP \(bu 2 api_key \- Password for Keystone authentication. .IP \(bu 2 project_name \- Keystone Tenant name. .IP \(bu 2 project_id \- Keystone Tenant id. .IP \(bu 2 input_auth_token \- Keystone authorization token. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fBImportant!\fP 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. .UNINDENT .SS Authentication check .sp If a user already has a Keystone authentication token, it may be used in \fIinput_auth_token\fP parameter. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C from saharaclient.api.client import Client as saharaclient sahara = saharaclient(sahara_url="http://sahara:8386/v1.1", project_id="11111111\-2222\-3333\-4444\-555555555555", input_auth_token="66666666\-7777\-8888\-9999\-000000000000") .ft P .fi .UNINDENT .UNINDENT .sp In this case no other authentication parameters are required and \fIinput_auth_token\fP has a higher priority than other parameters. Otherwise user has to provide: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 auth_url .IP \(bu 2 username .IP \(bu 2 api_key .IP \(bu 2 any of project_name or project_id .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C from saharaclient.api.client import Client as saharaclient sahara = saharaclient(auth_url="http://keystone:5000/v2.0", sahara_url="http://sahara:8386/v1.1", username="user", api_key="PaSsWoRd", project_name="demo\-project") .ft P .fi .UNINDENT .UNINDENT .SS Sahara endpoint discovery .sp If user has a direct URL pointing to Sahara REST API, it may be specified as \fIsahara_url\fP\&. If this parameter is missing, Sahara client will use Keystone Service Catalog to find the endpoint. There are two parameters: \fIservice_type\fP and \fIendpoint_type\fP to configure endpoint search. Both parameters have default values. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C from saharaclient.api.client import Client as saharaclient sahara = saharaclient(auth_url="http://keystone:5000/v2.0", username="user", api_key="PaSsWoRd", project_name="demo\-project", service_type="non\-default\-service\-type", endpoint_type="internalURL") .ft P .fi .UNINDENT .UNINDENT .SS Tenant specification .sp All Sahara operations should be performed in one of OpenStack tenants. There are two parameters: \fIproject_name\fP and \fIproject_id\fP which allow to specify a tenant. \fIproject_id\fP parameter has a higher priority. .SS Object managers .sp Sahara Client has a list of fields to operate with: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 plugins .IP \(bu 2 clusters .IP \(bu 2 cluster_templates .IP \(bu 2 node_group_templates .IP \(bu 2 images .IP \(bu 2 data_sources .IP \(bu 2 job_binaries .IP \(bu 2 job_binary_internals .IP \(bu 2 job_executions .UNINDENT .UNINDENT .UNINDENT .sp Each of this fields is a reference to a Manager for a corresponding group of REST calls. .SS Supported operations .sp The following methods are allowed for all Managers: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 list() \- Get a list of all objects of specified type. .IP \(bu 2 get(id) \- Get an object by id. (In case of plugins, the Plugin name should be provided) .IP \(bu 2 delete(id) \- Delete an object by id. (Available only for templates and EDP objects) .UNINDENT .UNINDENT .UNINDENT .SS Plugin Manager ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 get_version_details(plugin_name, hadoop_version) \- Get the list of Services and Service Parameters for a specified Plugin and Hadoop Version .IP \(bu 2 convert_to_cluster_template(plugin_name, hadoop_version, template_name, filecontent) \- This call is used to create Cluster Templates directly, avoiding Cluster Template mechanism. .UNINDENT .UNINDENT .UNINDENT .SS Image Registry ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 update_image(image_id, user_name, descr) \- Create or update an Image in Image Registry. .IP \(bu 2 unregister_image(image_id) \- Remove an Image from Sahara Image Registry. .IP \(bu 2 update_tags(image_id, new_tags) \- Updates Image tags. \fInew_tags\fP list will replace currently assigned tags. .UNINDENT .UNINDENT .UNINDENT .SS Node Group Template ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 create(name, plugin_name, hadoop_version, flavor_id, description, volumes_per_node, volumes_size, node_processes, node_configs, floating_ip_pool) \- Create a Node Group Template with specified parameters. .UNINDENT .UNINDENT .UNINDENT .SS Cluster Template ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 create(name, plugin_name, hadoop_version, description, cluster_configs, node_groups, anti_affinity, net_id) \- Create a Cluster Template with specified parameters. .UNINDENT .UNINDENT .UNINDENT .SS Cluster ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 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) \- Launch a Cluster with specified parameters. .IP \(bu 2 scale(cluster_id, scale_object) \- Scale an existing Cluster. \fIscale_object\fP format is described in REST API doc. .UNINDENT .UNINDENT .UNINDENT .SS Data Source ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 create(name, description, data_source_type, url, credential_user, credential_pass) \- Create a Data Source with specified parameters. .UNINDENT .UNINDENT .UNINDENT .SS Job Binary Internal ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 create(name, data) \- Create a Job Binary Internal from provided \fIdata\fP\&. .UNINDENT .UNINDENT .UNINDENT .SS Job Binary ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 create(name, url, description, extra) \- Create a Job Binary with specified parameters. .IP \(bu 2 get_file(job_binary_id) \- Download a Job Binary .UNINDENT .UNINDENT .UNINDENT .SS Job ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 create(name, type, mains, libs, description) \- Create a Job with specified parameters. .IP \(bu 2 get_configs(job_type) \- Get config hints for a specified Job type. .UNINDENT .UNINDENT .UNINDENT .SS Job Execution ops .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 create(job_id, cluster_id, input_id, output_id, configs) \- Launch a Job with specified parameters. .UNINDENT .UNINDENT .UNINDENT .sp Code is hosted in \fI\%review.o.o\fP and mirrored to \fI\%github\fP and \fI\%git.o.o\fP . Submit bugs to the Sahara project on \fI\%launchpad\fP and to the Sahara client on \fI\%launchpad_client\fP\&. Submit code to the openstack/python\-saharaclient project using \fI\%gerrit\fP\&. .SH AUTHOR OpenStack Foundation .SH COPYRIGHT 2013, OpenStack Foundation .\" Generated by docutils manpage writer. .