Re: [Openstack] need help on swift and python
Hi Christophe, I have just moved one step ahead and able to import cloudfiles library in my python code. Now, I am trying to run the example you have provided. I am getting the below error. raise AuthenticationFailed() cloudfiles.errors.AuthenticationFailed Do you have any idea on this? Thanks Regards Yogesh Bansal -Original Message- From: Chmouel Boudjnah [mailto:chmo...@chmouel.com] Sent: 27 June 2012 AM 1:50 To: Christophe Le Guern Cc: Yogesh Bansal; openstack@lists.launchpad.net Subject: Re: [Openstack] need help on swift and python Yogesh, a couple of years ago I wrote some simple cloudfiles functions that uses python-cloudfiles to do some common task which you may want to look at to see how it's done, available here : https://github.com/chmouel/cloud-files-helper Chmouel On Tue, Jun 26, 2012 at 8:31 AM, Christophe Le Guern c35...@gmail.com wrote: Hi Yogesh, Here is an example using swauth middleware and swift: ** from cloudfiles.connection import Connection conn = Connection(account:user, password, authurl=https://SWIFT-URL/auth/v1.0;) container = conn.create_container(mycontainer) obj = container.create_object(myobject.txt) obj.content_type = text/plain obj.write(Hello World) ** Christophe On Tue, Jun 26, 2012 at 7:14 AM, Yogesh Bansal yogeshbansa...@gmail.com wrote: Hi, I want to upload a file or image on swift object storage server. I can do it using curl command. But I am not able to do it using python apis. I am using Django and python to make web based application, which required to store file from client to swift object storage server. Is there any swift and python experts, who can guide me in this regard. I am able to create and list containers using python. An example will be very helpful. Thanks Yogesh Bansal ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] need help on swift and python
Hi Chmouel, I am using window machine for my developemt. I have install the python-cloudfiles and can see in the python path. But still I am unable to import the cloudfiles into my code. Can you suggest where I am doing any mistake. Thanks Regards Yogesh Bansal -Original Message- From: Chmouel Boudjnah [mailto:chmo...@chmouel.com] Sent: 27 June 2012 AM 1:50 To: Christophe Le Guern Cc: Yogesh Bansal; openstack@lists.launchpad.net Subject: Re: [Openstack] need help on swift and python Yogesh, a couple of years ago I wrote some simple cloudfiles functions that uses python-cloudfiles to do some common task which you may want to look at to see how it's done, available here : https://github.com/chmouel/cloud-files-helper Chmouel On Tue, Jun 26, 2012 at 8:31 AM, Christophe Le Guern c35...@gmail.com wrote: Hi Yogesh, Here is an example using swauth middleware and swift: ** from cloudfiles.connection import Connection conn = Connection(account:user, password, authurl=https://SWIFT-URL/auth/v1.0;) container = conn.create_container(mycontainer) obj = container.create_object(myobject.txt) obj.content_type = text/plain obj.write(Hello World) ** Christophe On Tue, Jun 26, 2012 at 7:14 AM, Yogesh Bansal yogeshbansa...@gmail.com wrote: Hi, I want to upload a file or image on swift object storage server. I can do it using curl command. But I am not able to do it using python apis. I am using Django and python to make web based application, which required to store file from client to swift object storage server. Is there any swift and python experts, who can guide me in this regard. I am able to create and list containers using python. An example will be very helpful. Thanks Yogesh Bansal ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
[Openstack] need help on swift and python
Hi, I want to upload a file or image on swift object storage server. I can do it using curl command. But I am not able to do it using python apis. I am using Django and python to make web based application, which required to store file from client to swift object storage server. Is there any swift and python experts, who can guide me in this regard. I am able to create and list containers using python. An example will be very helpful. Thanks Yogesh Bansal ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
[Openstack] Need help and guidance of Openstack Swift
Hello Friends, I have just started using Openstack. I am trying to make a web based application for Openstack swift. I am using the Django and python for my application. Could you please provide me few examples how to send the command to swift server using python. I am able to get the auth token from keystone and the public url for the swift storage. But when I tried to use that swift public URL, in response it say '403 Forbidden\n\nAccess was denied to this resource.\n\n and Django stops by giving this error message raise ValueError(errmsg(Extra data, s, end, len(s))) ValueError: Extra data: line 1 column 4 - line 5 column 4 (char 4 - 55) I am able to run the curl commands with are provided in the Openstack documentation and its running fine. I just need help using python. I am learning python and Django also. I have little understanding on this. Could you please help and guide me on this. Thanks Yogesh ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp
Re: [Openstack] Need help and guidance of Openstack Swift
Hi Jay, Thanks a lot for quick response. This was little helpful. I need how to send the parameters to the swift server by making the connection. I think that task is happening in inside the below code. Could you please tell me what is happening in cloudfiles.get_connection method def swift_api(request): endpoint = url_for(request, 'object-store') LOG.debug('Swift connection created using token %s and url %s' % (request.session['token'], endpoint)) auth = SwiftAuthentication(endpoint, request.session['token']) return cloudfiles.get_connection(auth=auth) Thanks Regards Yogesh Bansal -Original Message- From: openstack-bounces+yogeshbansal83=gmail@lists.launchpad.net [mailto:openstack-bounces+yogeshbansal83=gmail@lists.launchpad.net] On Behalf Of Jay Pipes Sent: 19 June 2012 AM 11:34 To: openstack@lists.launchpad.net Subject: Re: [Openstack] Need help and guidance of Openstack Swift Some links to show you: https://github.com/openstack/horizon/blob/7b565fc9839833b4b99b1fc3b02269b790 71af3e/horizon/api/swift.py https://github.com/openstack/horizon/blob/f6f2a91e14f6bdd4e1a87e31a1d6923127 afee1b/horizon/dashboards/nova/containers/views.py Best, -jay On 06/19/2012 02:04 PM, Yogesh Bansal wrote: Hello Friends, I have just started using Openstack.I am trying to make a web based application for Openstack swift. I am using the Django and python for my application. Could you please provide me few examples how to send the command to swift server using python. I am able to get the auth token from keystone and the public url for the swift storage. But when I tried to use that swift publicURL, in response it say *'403 Forbidden\n\nAccess was denied to this resource.\n\n* and Django stops by giving this error message raise ValueError(errmsg(Extra data, s, end, len(s))) ValueError: Extra data: line 1 column 4 - line 5 column 4 (char 4 - 55) I am able to run the curl commands with are provided in the Openstack documentation and its running fine.I just need help using python. I am learning python and Django also. I have little understanding on this. Could you please help and guide me on this. Thanks Yogesh ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp ___ Mailing list: https://launchpad.net/~openstack Post to : openstack@lists.launchpad.net Unsubscribe : https://launchpad.net/~openstack More help : https://help.launchpad.net/ListHelp