Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.12.1
    • Component/s: Storage

      Description

      The Cloud Files backend could support the edge CDN purging feature which the native cloudfiles library handles:

      http://packages.python.org/python-cloudfiles/cloudfiles.container.Container-class.html#purge_from_cdn

        Activity

        Hide
        kami Tomaz Muraus added a comment -

        Added new ex_purge_object_from_cdn method and confirmed that it's working by testing it with the CloudFiles API - http://svn.apache.org/viewvc?view=revision&revision=1417732

        Show
        kami Tomaz Muraus added a comment - Added new ex_purge_object_from_cdn method and confirmed that it's working by testing it with the CloudFiles API - http://svn.apache.org/viewvc?view=revision&revision=1417732
        Hide
        kami Tomaz Muraus added a comment -

        Yeah, this actually makes sense.

        No problem, I'll remove this method from trunk and add a new one for purging a single object.

        Show
        kami Tomaz Muraus added a comment - Yeah, this actually makes sense. No problem, I'll remove this method from trunk and add a new one for purging a single object.
        Hide
        acdha Chris Adams added a comment -

        I'm sorry, I should have tested that by hand first. It looks like they've quietly discontinued that feature as I now receive a 405 Method not allowed error attempting to issue a purge.

        Traceback (most recent call last):
        File "/Users/cadams/Projects/simple-cloud-site/bin/publish-site", line 113, in <module>
        main()
        File "/Users/cadams/Projects/simple-cloud-site/bin/publish-site", line 108, in main
        driver.ex_purge_from_cdn(container, email='chris@improbable.org')
        File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/storage/drivers/cloudfiles.py", line 420, in ex_purge_from_cdn
        cdn_request=True)
        File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/storage/drivers/cloudfiles.py", line 159, in request
        raw=raw)
        File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/common/openstack.py", line 461, in request
        return super(OpenStackBaseConnection, self).request(**kwargs)
        File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/common/base.py", line 605, in request
        connection=self)
        File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/common/base.py", line 93, in _init_
        raise Exception(self.parse_error())
        Exception: 405 Method Not Allowed

        A quick test with curl shows the object-level purging works, so it would appear that this is the only viable feature at the moment:

        http://docs.rackspace.com/files/api/v1/cf-devguide/content/Purge_CDN-Enabled_Objects-d1e3858.html

        curl -i -XDELETE -H "X-Auth-Token: …" -H "X-Purge-Email: chris@improbable.org" https://cdn1.clouddrive.com/v1/…/container_name/index.html

        Show
        acdha Chris Adams added a comment - I'm sorry, I should have tested that by hand first. It looks like they've quietly discontinued that feature as I now receive a 405 Method not allowed error attempting to issue a purge. Traceback (most recent call last): File "/Users/cadams/Projects/simple-cloud-site/bin/publish-site", line 113, in <module> main() File "/Users/cadams/Projects/simple-cloud-site/bin/publish-site", line 108, in main driver.ex_purge_from_cdn(container, email='chris@improbable.org') File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/storage/drivers/cloudfiles.py", line 420, in ex_purge_from_cdn cdn_request=True) File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/storage/drivers/cloudfiles.py", line 159, in request raw=raw) File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/common/openstack.py", line 461, in request return super(OpenStackBaseConnection, self).request(**kwargs) File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/common/base.py", line 605, in request connection=self) File "/Users/cadams/.virtualenvs/simple-cloud-site-py3/lib/python3.3/site-packages/libcloud/common/base.py", line 93, in _ init _ raise Exception(self.parse_error()) Exception: 405 Method Not Allowed A quick test with curl shows the object-level purging works, so it would appear that this is the only viable feature at the moment: http://docs.rackspace.com/files/api/v1/cf-devguide/content/Purge_CDN-Enabled_Objects-d1e3858.html curl -i -XDELETE -H "X-Auth-Token: …" -H "X-Purge-Email: chris@improbable.org" https://cdn1.clouddrive.com/v1/ …/container_name/index.html
        Hide
        kami Tomaz Muraus added a comment - - edited

        I've added this functionality as an extension method in trunk - http://svn.apache.org/viewvc?view=revision&revision=r1416790.

        Keep in mind that I've added this feature reluctantly, because it's not even documented in the Rackspace CloudFiles API documentation -http://docs.rackspace.com/files/api/v1/cf-devguide/content/Purge_CDN-Enabled_Containers_or_Objects-d1e2747.html.

        I assume the reason for not documenting it is, that it puts extra load on the CDN provider and people could abuse it...

        Please let me know if you find any problems while testing it, I actually haven't had time to test it with Rackspace API yet.

        Show
        kami Tomaz Muraus added a comment - - edited I've added this functionality as an extension method in trunk - http://svn.apache.org/viewvc?view=revision&revision=r1416790 . Keep in mind that I've added this feature reluctantly, because it's not even documented in the Rackspace CloudFiles API documentation - http://docs.rackspace.com/files/api/v1/cf-devguide/content/Purge_CDN-Enabled_Containers_or_Objects-d1e2747.html . I assume the reason for not documenting it is, that it puts extra load on the CDN provider and people could abuse it... Please let me know if you find any problems while testing it, I actually haven't had time to test it with Rackspace API yet.

          People

          • Assignee:
            kami Tomaz Muraus
            Reporter:
            acdha Chris Adams
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development