Yes Rohit. TO is the correct way to send details to Resource layer. @Wido Looking forward to the commits. Let me know if you have any questions.
-----Original Message----- From: Wido den Hollander <w...@widodh.nl.INVALID> Sent: Tuesday, December 12, 2023 2:28 PM To: dev@cloudstack.apache.org; Rohit Yadav <rohit.ya...@shapeblue.com>; kis...@apache.org Subject: Re: Question about ObjectStoreDriver for implementing Ceph driver Op 12/12/2023 om 04:45 schreef Rohit Yadav: > Hi Wido, > > I think when the minio object storage plugin was written we didn’t have the > limitations or foresight on how to structure the code, I would agree in > refactoring the interface enough to allow what you’re trying to achieve. > > Typically to a plugin you don’t want to pass database objects (Dao or VO) but > a transform them as transfer object (TO) that doesn’t introduce dao or schema > pkg dependencies to the plugin and TOs are kept as simple Java object. In the > TO you can introduce fields and getters that suit your use cases. > Got it, thanks for the feedback! I'll work on this in two different commits. Wido > Regards. > > Regards. > ________________________________ > From: Wido den Hollander <w...@widodh.nl.INVALID> > Sent: Tuesday, December 12, 2023 1:28:56 AM > To: dev@cloudstack.apache.org <dev@cloudstack.apache.org>; > kis...@apache.org <kis...@apache.org> > Subject: Question about ObjectStoreDriver for implementing Ceph driver > > Hi (Kishan), > > I am making a first attempt [0] to implement a Ceph RGW [1] Object > Store Driver for CloudStack and I have a few questions about the code. > > While implementing the Ceph RGW driver I have noticed that some > methods are provided the bucket's name (as a String) as an argument, > but I'd rather have a 'Bucket' object, for example: > > public AccessControlList getBucketAcl(String bucketName, long storeId) > public boolean setBucketEncryption(String bucketName, long storeId) > > In Ceph's case it would be better if these methods would get a Bucket > object, like: > > > public AccessControlList getBucketAcl(Bucket bucket, long storeId) > > The reason is that I need to access the Account the bucket belongs to. > With Minio there is an 'Admin' client which allows you to do all these > operations as an Admin, but with Ceph there isn't. With Ceph you are > supposed to obtain the credentials (access + secret) via an Admin API > [2] and then execute these commands as the user. > > Now, we have the access + secret key from the account recorded under > the account and we can access that from the Bucket object: > > bucket.getAccessKey() > bucket.getSecretKey() > > My proposal would be to change the signature of these methods, but > before I do so, is there any particular reason the String was passed > and not the whole Bucket object? > > Thanks, > > Wido > > [0]: https://github.com/wido/cloudstack/commits/ceph-object-store > [1]: https://ceph.io/en/discover/technology/#object > [2]: > https://www.javadoc.io/doc/io.github.twonote/radosgw-admin4j/latest/or > g/twonote/rgwadmin4j/RgwAdmin.html > > > >