Use Openstack SDK for Swift
I'm writing a script that will use admin credentials to check user projects for containers. I'm already doing something similar for non-swift accounts, doing things like: cloud.network.networks(project_id=projectid): I read here about the Object SDK: https://docs.openstack.org/openstacksdk/latest/user/guides/object_store.html And I tried this: cloud.object_store.containers(project_id=projectid): But I get an error: Invalid query params: project_id I read the Object SDK document here and it doesn't seem to say anything about how to specify a project: https://docs.openstack.org/openstacksdk/latest/user/proxies/object_store.htm... But when I read the Swift API document, I see that I can use "/v1/{account}/{container}", so I'm guessing that there must be a way to do it via the SDK. https://docs.openstack.org/api-ref/object-store/#show-container-details-and-... Is it possible to specify the project in an Object SDK call, or do I need to use the old python API for this?
I didn't see a response to this email so I am re-sending. On Tuesday, February 20, 2024 at 03:59:19 PM EST, Albert Braden <ozzzo@yahoo.com> wrote: I'm writing a script that will use admin credentials to check user projects for containers. I'm already doing something similar for non-swift accounts, doing things like: cloud.network.networks(project_id=projectid): I read here about the Object SDK: https://docs.openstack.org/openstacksdk/latest/user/guides/object_store.html And I tried this: cloud.object_store.containers(project_id=projectid): But I get an error: Invalid query params: project_id I read the Object SDK document here and it doesn't seem to say anything about how to specify a project: https://docs.openstack.org/openstacksdk/latest/user/proxies/object_store.htm... But when I read the Swift API document, I see that I can use "/v1/{account}/{container}", so I'm guessing that there must be a way to do it via the SDK. https://docs.openstack.org/api-ref/object-store/#show-container-details-and-... Is it possible to specify the project in an Object SDK call, or do I need to use the old python API for this?
On Tue, 20 Feb 2024 20:59:19 +0000 (UTC) Albert Braden <ozzzo@yahoo.com> wrote:
I'm writing a script that will use admin credentials to check user projects for containers. . . .
cloud.object_store.containers(project_id=projectid): Invalid query params: project_id
I'm sure you can resolve the parameter issue above. It looks pretty tactical to me. However, your overall problem requires what's known as "third party authentication". I proposed to support it in SDK a while ago, but that patch needs some love: get someone review and approve it https://review.opendev.org/c/openstack/python-openstackclient/+/731395 Assuming that I understood your objective correctly, of course. -- Pete
participants (2)
-
Albert Braden
-
Pete Zaitcev