I want to write a python script and visual interface to manage glusterfs, such as creating and deleting volumes.This can be easier to manage glusterfs? But,now ,I execute the glusterfs command using python's subprocess.popen function?such as subprocess.Popen(GLUSTER_CMD, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)...... But this does not feel like a good program, Because it has a serious dependence on the shell Is there a python or c library/function to execute the glusterfs command?So I can develop a better performance, more lightweight script. to achieve this optimization script thanks everyone. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20180115/f80977d8/attachment.html>
Maybe consider extending the functionality of http://docs.ansible.com/ansible/latest/gluster_volume_module.html? Best regards, Marcin On Mon, Jan 15, 2018 at 11:53 AM, ?? <mrchenx at 126.com> wrote:> I want to write a python script and visual interface to manage glusterfs, > such as creating and deleting volumes.This can be easier to manage > glusterfs? > But,now ,I execute the glusterfs command using python's > subprocess.popen function?such as subprocess.Popen(GLUSTER_CMD, > shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)...... > But this does not feel like a good program, Because it has a serious > dependence on the shell > Is there a python or c library/function to execute the glusterfs > command?So I can develop a better performance, more lightweight script. to > achieve this optimization script > thanks everyone. > > > > > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://lists.gluster.org/mailman/listinfo/gluster-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20180115/ce634b6a/attachment.html>
You should try libgfapi: https://libgfapi-python.readthedocs.io/en/latest/ On Mon, Jan 15, 2018 at 9:01 PM, Marcin Dulak <marcin.dulak at gmail.com> wrote:> Maybe consider extending the functionality of > http://docs.ansible.com/ansible/latest/gluster_volume_module.html? > > Best regards, > > Marcin > > On Mon, Jan 15, 2018 at 11:53 AM, ?? <mrchenx at 126.com> wrote: >> >> I want to write a python script and visual interface to manage glusterfs, >> such as creating and deleting volumes.This can be easier to manage >> glusterfs? >> But,now ,I execute the glusterfs command using python's subprocess.popen >> function?such as subprocess.Popen(GLUSTER_CMD, >> shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)...... >> But this does not feel like a good program, Because it has a serious >> dependence on the shell >> Is there a python or c library/function to execute the glusterfs >> command?So I can develop a better performance, more lightweight script. to >> achieve this optimization script >> thanks everyone. >> >> >> >> >> >> _______________________________________________ >> Gluster-users mailing list >> Gluster-users at gluster.org >> http://lists.gluster.org/mailman/listinfo/gluster-users > > > > _______________________________________________ > Gluster-users mailing list > Gluster-users at gluster.org > http://lists.gluster.org/mailman/listinfo/gluster-users
On Mon, Jan 15, 2018 at 2:53 AM, ?? <mrchenx at 126.com> wrote:> I want to write a python script and visual interface to manage glusterfs, > such as creating and deleting volumes.This can be easier to manage > glusterfs? > But,now ,I execute the glusterfs command using python's > subprocess.popen function?such as subprocess.Popen(GLUSTER_CMD, > shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)...... > But this does not feel like a good program, Because it has a serious > dependence on the shell > Is there a python or c library/function to execute the glusterfs > command?So I can develop a better performance, more lightweight script. to > achieve this optimization script > >glusterd2 will provide ReSTful APIs [1] for volume management and will be available from 4.0. That could be easier for invoking from python. Regards, Vijay [1] https://github.com/gluster/glusterd2/wiki/ReST-API -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20180115/c3338830/attachment.html>
thank you very much, I will attention to it chenx ? 2018-01-16 03:14:28?"Vijay Bellur" <vbellur at redhat.com> ??? On Mon, Jan 15, 2018 at 2:53 AM, ?? <mrchenx at 126.com> wrote: I want to write a python script and visual interface to manage glusterfs, such as creating and deleting volumes.This can be easier to manage glusterfs? But,now ,I execute the glusterfs command using python's subprocess.popen function?such as subprocess.Popen(GLUSTER_CMD, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)...... But this does not feel like a good program, Because it has a serious dependence on the shell Is there a python or c library/function to execute the glusterfs command?So I can develop a better performance, more lightweight script. to achieve this optimization script glusterd2 will provide ReSTful APIs [1] for volume management and will be available from 4.0. That could be easier for invoking from python. Regards, Vijay [1] https://github.com/gluster/glusterd2/wiki/ReST-API -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20180116/af45490e/attachment.html>
thank you very much, I will attention to it chenx At 2018-01-16 02:01:21, "Marcin Dulak" <marcin.dulak at gmail.com> wrote: Maybe consider extending the functionality of http://docs.ansible.com/ansible/latest/gluster_volume_module.html? Best regards, Marcin On Mon, Jan 15, 2018 at 11:53 AM, ?? <mrchenx at 126.com> wrote: I want to write a python script and visual interface to manage glusterfs, such as creating and deleting volumes.This can be easier to manage glusterfs? But,now ,I execute the glusterfs command using python's subprocess.popen function?such as subprocess.Popen(GLUSTER_CMD, shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)...... But this does not feel like a good program, Because it has a serious dependence on the shell Is there a python or c library/function to execute the glusterfs command?So I can develop a better performance, more lightweight script. to achieve this optimization script thanks everyone. _______________________________________________ Gluster-users mailing list Gluster-users at gluster.org http://lists.gluster.org/mailman/listinfo/gluster-users -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.gluster.org/pipermail/gluster-users/attachments/20180116/f4a9f749/attachment.html>