[FEAT] - improvement in the object-storage public-url
option
#41
Labels
enhancement
New feature or request
public-url
option
#41
Is your feature request related to a problem? Please describe.
It seems that the options
mgc object-storage <entity> public-url --dst <entry>
produces the same output for bothentity = objects, buckets
. They seems to simply construct a url based on<entry>
and on region. If the command is for a kind of<entity>
, I would receive an output only for an<entry>
of that kind.I see two problems:
mgc object-storage objects public-url --dst bucket_name
should not output the public url for that bucket with givenbucket_name
, since the command is supposed to operate only overobjects
. Similarly,mgc object-storage buckets public-url --dst bucket_name/path/to/object
should not print the url for the object, since now we are executing the command forbuckets
, not forobjects
.objects
andbuckets
, it is presupposed that they return an output only if the corresponding<entry>
there exists and is owned by the user executing that command.Describe the solution you'd like
I could suggest two approaches to improve the described situation:
<entity>
calledpublic-url
, so that one could simply executemgc object-storage public-url --dst whatever/one/needs
. In this case, one should validate if the--dst
there exists before printing its public urlpublic-url
for bothobjects
andbuckets
to work only with<entry>
of the corresponding kind. In this case, before printing its public url, one should validate if the--dst
there exists and is owned by the user executing the command.In my opinion the first option is preferable, although it could imply in modifying the semantics of the command
mgc object-storage
.Additional context
<entry>
does not exists or cannot be accessed by the user could cause a misunderstood.public-url
: [BUG] - displaying wrong public urls for objects/buckets #40The text was updated successfully, but these errors were encountered: