diff options
Diffstat (limited to 'src/rgw/rgw_admin.cc')
-rw-r--r-- | src/rgw/rgw_admin.cc | 926 |
1 files changed, 439 insertions, 487 deletions
diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 01a07f2c2de..3d817c6039b 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -6,7 +6,6 @@ #include <sstream> #include <string> -#include <boost/asio.hpp> #include <boost/optional.hpp> extern "C" { @@ -63,6 +62,7 @@ extern "C" { #include "rgw_lua.h" #include "rgw_sal.h" #include "rgw_sal_config.h" +#include "rgw_data_access.h" #include "services/svc_sync_modules.h" #include "services/svc_cls.h" @@ -132,379 +132,363 @@ void usage() { cout << "usage: radosgw-admin <cmd> [options...]" << std::endl; cout << "commands:\n"; - cout << " user create create a new user\n" ; - cout << " user modify modify user\n"; - cout << " user info get user info\n"; - cout << " user rename rename user\n"; - cout << " user rm remove user\n"; - cout << " user suspend suspend a user\n"; - cout << " user enable re-enable user after suspension\n"; - cout << " user check check user info\n"; - cout << " user stats show user stats as accounted by quota subsystem\n"; - cout << " user list list users\n"; - cout << " caps add add user capabilities\n"; - cout << " caps rm remove user capabilities\n"; - cout << " subuser create create a new subuser\n" ; - cout << " subuser modify modify subuser\n"; - cout << " subuser rm remove subuser\n"; - cout << " key create create access key\n"; - cout << " key rm remove access key\n"; - cout << " bucket list list buckets (specify --allow-unordered for\n"; - cout << " faster, unsorted listing)\n"; - cout << " bucket limit check show bucket sharding stats\n"; - cout << " bucket link link bucket to specified user\n"; - cout << " bucket unlink unlink bucket from specified user\n"; - cout << " bucket stats returns bucket statistics\n"; - cout << " bucket rm remove bucket\n"; - cout << " bucket check check bucket index by verifying size and object count stats\n"; - cout << " bucket check olh check for olh index entries and objects that are pending removal\n"; - cout << " bucket check unlinked check for object versions that are not visible in a bucket listing \n"; - cout << " bucket chown link bucket to specified user and update its object ACLs\n"; - cout << " bucket reshard reshard bucket\n"; - cout << " bucket rewrite rewrite all objects in the specified bucket\n"; - cout << " bucket sync checkpoint poll a bucket's sync status until it catches up to its remote\n"; - cout << " bucket sync disable disable bucket sync\n"; - cout << " bucket sync enable enable bucket sync\n"; - cout << " bucket radoslist list rados objects backing bucket's objects\n"; - cout << " bi get retrieve bucket index object entries\n"; - cout << " bi put store bucket index object entries\n"; - cout << " bi list list raw bucket index entries\n"; - cout << " bi purge purge bucket index entries\n"; - cout << " object rm remove object\n"; - cout << " object put put object\n"; - cout << " object stat stat an object for its metadata\n"; - cout << " object unlink unlink object from bucket index\n"; - cout << " object rewrite rewrite the specified object\n"; - cout << " object reindex reindex the object(s) indicated by --bucket and either --object or --objects-file\n"; - cout << " objects expire run expired objects cleanup\n"; - cout << " objects expire-stale list list stale expired objects (caused by reshard)\n"; - cout << " objects expire-stale rm remove stale expired objects\n"; - cout << " period rm remove a period\n"; - cout << " period get get period info\n"; - cout << " period get-current get current period info\n"; - cout << " period pull pull a period\n"; - cout << " period push push a period\n"; - cout << " period list list all periods\n"; - cout << " period update update the staging period\n"; - cout << " period commit commit the staging period\n"; - cout << " quota set set quota params\n"; - cout << " quota enable enable quota\n"; - cout << " quota disable disable quota\n"; - cout << " ratelimit get get ratelimit params\n"; - cout << " ratelimit set set ratelimit params\n"; - cout << " ratelimit enable enable ratelimit\n"; - cout << " ratelimit disable disable ratelimit\n"; - cout << " global quota get view global quota params\n"; - cout << " global quota set set global quota params\n"; - cout << " global quota enable enable a global quota\n"; - cout << " global quota disable disable a global quota\n"; - cout << " global ratelimit get view global ratelimit params\n"; - cout << " global ratelimit set set global ratelimit params\n"; - cout << " global ratelimit enable enable a ratelimit quota\n"; - cout << " global ratelimit disable disable a ratelimit quota\n"; - cout << " realm create create a new realm\n"; - cout << " realm rm remove a realm\n"; - cout << " realm get show realm info\n"; - cout << " realm get-default get default realm name\n"; - cout << " realm list list realms\n"; - cout << " realm list-periods list all realm periods\n"; - cout << " realm rename rename a realm\n"; - cout << " realm set set realm info (requires infile)\n"; - cout << " realm default set realm as default\n"; - cout << " realm pull pull a realm and its current period\n"; - cout << " zonegroup add add a zone to a zonegroup\n"; - cout << " zonegroup create create a new zone group info\n"; - cout << " zonegroup default set default zone group\n"; - cout << " zonegroup delete delete a zone group info\n"; - cout << " zonegroup get show zone group info\n"; - cout << " zonegroup modify modify an existing zonegroup\n"; - cout << " zonegroup set set zone group info (requires infile)\n"; - cout << " zonegroup rm remove a zone from a zonegroup\n"; - cout << " zonegroup rename rename a zone group\n"; - cout << " zonegroup list list all zone groups set on this cluster\n"; - cout << " zonegroup placement list list zonegroup's placement targets\n"; - cout << " zonegroup placement get get a placement target of a specific zonegroup\n"; - cout << " zonegroup placement add add a placement target id to a zonegroup\n"; - cout << " zonegroup placement modify modify a placement target of a specific zonegroup\n"; - cout << " zonegroup placement rm remove a placement target from a zonegroup\n"; - cout << " zonegroup placement default set a zonegroup's default placement target\n"; - cout << " zone create create a new zone\n"; - cout << " zone rm remove a zone\n"; - cout << " zone get show zone cluster params\n"; - cout << " zone modify modify an existing zone\n"; - cout << " zone set set zone cluster params (requires infile)\n"; - cout << " zone list list all zones set on this cluster\n"; - cout << " zone rename rename a zone\n"; - cout << " zone placement list list zone's placement targets\n"; - cout << " zone placement get get a zone placement target\n"; - cout << " zone placement add add a zone placement target\n"; - cout << " zone placement modify modify a zone placement target\n"; - cout << " zone placement rm remove a zone placement target\n"; - cout << " metadata sync status get metadata sync status\n"; - cout << " metadata sync init init metadata sync\n"; - cout << " metadata sync run run metadata sync\n"; - cout << " data sync status get data sync status of the specified source zone\n"; - cout << " data sync init init data sync for the specified source zone\n"; - cout << " data sync run run data sync for the specified source zone\n"; - cout << " pool add add an existing pool for data placement\n"; - cout << " pool rm remove an existing pool from data placement set\n"; - cout << " pools list list placement active set\n"; - cout << " policy read bucket/object policy\n"; - cout << " log list list log objects\n"; - cout << " log show dump a log from specific object or (bucket + date\n"; - cout << " + bucket-id)\n"; - cout << " (NOTE: required to specify formatting of date\n"; - cout << " to \"YYYY-MM-DD-hh\")\n"; - cout << " log rm remove log object\n"; - cout << " usage show show usage (by user, by bucket, date range)\n"; - cout << " usage trim trim usage (by user, by bucket, date range)\n"; - cout << " usage clear reset all the usage stats for the cluster\n"; - cout << " gc list dump expired garbage collection objects (specify\n"; - cout << " --include-all to list all entries, including unexpired)\n"; - cout << " gc process manually process garbage (specify\n"; - cout << " --include-all to process all entries, including unexpired)\n"; - cout << " lc list list all bucket lifecycle progress\n"; - cout << " lc get get a lifecycle bucket configuration\n"; - cout << " lc process manually process lifecycle\n"; - cout << " lc reshard fix fix LC for a resharded bucket\n"; - cout << " metadata get get metadata info\n"; - cout << " metadata put put metadata info\n"; - cout << " metadata rm remove metadata info\n"; - cout << " metadata list list metadata info\n"; - cout << " mdlog list list metadata log\n"; - cout << " mdlog autotrim auto trim metadata log\n"; - cout << " mdlog trim trim metadata log (use marker)\n"; - cout << " mdlog status read metadata log status\n"; - cout << " bilog list list bucket index log\n"; - cout << " bilog trim trim bucket index log (use start-marker, end-marker)\n"; - cout << " bilog status read bucket index log status\n"; - cout << " bilog autotrim auto trim bucket index log\n"; - cout << " datalog list list data log\n"; - cout << " datalog trim trim data log\n"; - cout << " datalog status read data log status\n"; - cout << " datalog type change datalog type to --log_type={fifo,omap}\n"; - cout << " orphans find deprecated -- init and run search for leaked rados objects (use job-id, pool)\n"; - cout << " orphans finish deprecated -- clean up search for leaked rados objects\n"; - cout << " orphans list-jobs deprecated -- list the current job-ids for orphans search\n"; - cout << " * the three 'orphans' sub-commands are now deprecated; consider using the `rgw-orphan-list` tool\n"; - cout << " role create create a AWS role for use with STS\n"; - cout << " role delete remove a role\n"; - cout << " role get get a role\n"; - cout << " role list list roles with specified path prefix\n"; - cout << " role-trust-policy modify modify the assume role policy of an existing role\n"; - cout << " role-policy put add/update permission policy to role\n"; - cout << " role-policy list list policies attached to a role\n"; - cout << " role-policy get get the specified inline policy document embedded with the given role\n"; - cout << " role-policy delete remove policy attached to a role\n"; - cout << " role update update max_session_duration of a role\n"; - cout << " reshard add schedule a resharding of a bucket\n"; - cout << " reshard list list all bucket resharding or scheduled to be resharded\n"; - cout << " reshard status read bucket resharding status\n"; - cout << " reshard process process of scheduled reshard jobs\n"; - cout << " reshard cancel cancel resharding a bucket\n"; - cout << " reshard stale-instances list list stale-instances from bucket resharding\n"; + cout << " user create create a new user\n" ; + cout << " user modify modify user\n"; + cout << " user info get user info\n"; + cout << " user rename rename user\n"; + cout << " user rm remove user\n"; + cout << " user suspend suspend a user\n"; + cout << " user enable re-enable user after suspension\n"; + cout << " user check check user info\n"; + cout << " user stats show user stats as accounted by quota subsystem\n"; + cout << " user list list users\n"; + cout << " caps add add user capabilities\n"; + cout << " caps rm remove user capabilities\n"; + cout << " subuser create create a new subuser\n" ; + cout << " subuser modify modify subuser\n"; + cout << " subuser rm remove subuser\n"; + cout << " key create create access key\n"; + cout << " key rm remove access key\n"; + cout << " bucket list list buckets (specify --allow-unordered for faster, unsorted listing)\n"; + cout << " bucket limit check show bucket sharding stats\n"; + cout << " bucket link link bucket to specified user\n"; + cout << " bucket unlink unlink bucket from specified user\n"; + cout << " bucket stats returns bucket statistics\n"; + cout << " bucket rm remove bucket\n"; + cout << " bucket check check bucket index by verifying size and object count stats\n"; + cout << " bucket check olh check for olh index entries and objects that are pending removal\n"; + cout << " bucket check unlinked check for object versions that are not visible in a bucket listing \n"; + cout << " bucket chown link bucket to specified user and update its object ACLs\n"; + cout << " bucket reshard reshard bucket\n"; + cout << " bucket rewrite rewrite all objects in the specified bucket\n"; + cout << " bucket sync checkpoint poll a bucket's sync status until it catches up to its remote\n"; + cout << " bucket sync disable disable bucket sync\n"; + cout << " bucket sync enable enable bucket sync\n"; + cout << " bucket radoslist list rados objects backing bucket's objects\n"; + cout << " bi get retrieve bucket index object entries\n"; + cout << " bi put store bucket index object entries\n"; + cout << " bi list list raw bucket index entries\n"; + cout << " bi purge purge bucket index entries\n"; + cout << " object rm remove object\n"; + cout << " object put put object\n"; + cout << " object stat stat an object for its metadata\n"; + cout << " object unlink unlink object from bucket index\n"; + cout << " object rewrite rewrite the specified object\n"; + cout << " object reindex reindex the object(s) indicated by --bucket and either --object or --objects-file\n"; + cout << " objects expire run expired objects cleanup\n"; + cout << " objects expire-stale list list stale expired objects (caused by reshard)\n"; + cout << " objects expire-stale rm remove stale expired objects\n"; + cout << " period rm remove a period\n"; + cout << " period get get period info\n"; + cout << " period get-current get current period info\n"; + cout << " period pull pull a period\n"; + cout << " period push push a period\n"; + cout << " period list list all periods\n"; + cout << " period update update the staging period\n"; + cout << " period commit commit the staging period\n"; + cout << " quota set set quota params\n"; + cout << " quota enable enable quota\n"; + cout << " quota disable disable quota\n"; + cout << " ratelimit get get ratelimit params\n"; + cout << " ratelimit set set ratelimit params\n"; + cout << " ratelimit enable enable ratelimit\n"; + cout << " ratelimit disable disable ratelimit\n"; + cout << " global quota get view global quota params\n"; + cout << " global quota set set global quota params\n"; + cout << " global quota enable enable a global quota\n"; + cout << " global quota disable disable a global quota\n"; + cout << " global ratelimit get view global ratelimit params\n"; + cout << " global ratelimit set set global ratelimit params\n"; + cout << " global ratelimit enable enable a ratelimit quota\n"; + cout << " global ratelimit disable disable a ratelimit quota\n"; + cout << " realm create create a new realm\n"; + cout << " realm rm remove a realm\n"; + cout << " realm get show realm info\n"; + cout << " realm get-default get default realm name\n"; + cout << " realm list list realms\n"; + cout << " realm list-periods list all realm periods\n"; + cout << " realm rename rename a realm\n"; + cout << " realm set set realm info (requires infile)\n"; + cout << " realm default set realm as default\n"; + cout << " realm pull pull a realm and its current period\n"; + cout << " zonegroup add add a zone to a zonegroup\n"; + cout << " zonegroup create create a new zone group info\n"; + cout << " zonegroup default set default zone group\n"; + cout << " zonegroup delete delete a zone group info\n"; + cout << " zonegroup get show zone group info\n"; + cout << " zonegroup modify modify an existing zonegroup\n"; + cout << " zonegroup set set zone group info (requires infile)\n"; + cout << " zonegroup rm remove a zone from a zonegroup\n"; + cout << " zonegroup rename rename a zone group\n"; + cout << " zonegroup list list all zone groups set on this cluster\n"; + cout << " zonegroup placement list list zonegroup's placement targets\n"; + cout << " zonegroup placement get get a placement target of a specific zonegroup\n"; + cout << " zonegroup placement add add a placement target id to a zonegroup\n"; + cout << " zonegroup placement modify modify a placement target of a specific zonegroup\n"; + cout << " zonegroup placement rm remove a placement target from a zonegroup\n"; + cout << " zonegroup placement default set a zonegroup's default placement target\n"; + cout << " zone create create a new zone\n"; + cout << " zone rm remove a zone\n"; + cout << " zone get show zone cluster params\n"; + cout << " zone modify modify an existing zone\n"; + cout << " zone set set zone cluster params (requires infile)\n"; + cout << " zone list list all zones set on this cluster\n"; + cout << " zone rename rename a zone\n"; + cout << " zone placement list list zone's placement targets\n"; + cout << " zone placement get get a zone placement target\n"; + cout << " zone placement add add a zone placement target\n"; + cout << " zone placement modify modify a zone placement target\n"; + cout << " zone placement rm remove a zone placement target\n"; + cout << " metadata sync status get metadata sync status\n"; + cout << " metadata sync init init metadata sync\n"; + cout << " metadata sync run run metadata sync\n"; + cout << " data sync status get data sync status of the specified source zone\n"; + cout << " data sync init init data sync for the specified source zone\n"; + cout << " data sync run run data sync for the specified source zone\n"; + cout << " pool add add an existing pool for data placement\n"; + cout << " pool rm remove an existing pool from data placement set\n"; + cout << " pools list list placement active set\n"; + cout << " policy read bucket/object policy\n"; + cout << " log list list log objects\n"; + cout << " log show dump a log from specific object or (bucket + date + bucket-id)\n"; + cout << " (NOTE: required to specify formatting of date to \"YYYY-MM-DD-hh\")\n"; + cout << " log rm remove log object\n"; + cout << " usage show show usage (by user, by bucket, date range)\n"; + cout << " usage trim trim usage (by user, by bucket, date range)\n"; + cout << " usage clear reset all the usage stats for the cluster\n"; + cout << " gc list dump expired garbage collection objects (specify\n"; + cout << " --include-all to list all entries, including unexpired)\n"; + cout << " gc process manually process garbage (specify\n"; + cout << " --include-all to process all entries, including unexpired)\n"; + cout << " lc list list all bucket lifecycle progress\n"; + cout << " lc get get a lifecycle bucket configuration\n"; + cout << " lc process manually process lifecycle\n"; + cout << " lc reshard fix fix LC for a resharded bucket\n"; + cout << " metadata get get metadata info\n"; + cout << " metadata put put metadata info\n"; + cout << " metadata rm remove metadata info\n"; + cout << " metadata list list metadata info\n"; + cout << " mdlog list list metadata log\n"; + cout << " mdlog autotrim auto trim metadata log\n"; + cout << " mdlog trim trim metadata log (use marker)\n"; + cout << " mdlog status read metadata log status\n"; + cout << " bilog list list bucket index log\n"; + cout << " bilog trim trim bucket index log (use start-marker, end-marker)\n"; + cout << " bilog status read bucket index log status\n"; + cout << " bilog autotrim auto trim bucket index log\n"; + cout << " datalog list list data log\n"; + cout << " datalog trim trim data log\n"; + cout << " datalog status read data log status\n"; + cout << " datalog type change datalog type to --log_type={fifo,omap}\n"; + cout << " orphans find deprecated -- init and run search for leaked rados objects (use job-id, pool)\n"; + cout << " orphans finish deprecated -- clean up search for leaked rados objects\n"; + cout << " orphans list-jobs deprecated -- list the current job-ids for orphans search\n"; + cout << " * the three 'orphans' sub-commands are now deprecated; consider using the `rgw-orphan-list` tool\n"; + cout << " role create create a AWS role for use with STS\n"; + cout << " role delete remove a role\n"; + cout << " role get get a role\n"; + cout << " role list list roles with specified path prefix\n"; + cout << " role-trust-policy modify modify the assume role policy of an existing role\n"; + cout << " role-policy put add/update permission policy to role\n"; + cout << " role-policy list list policies attached to a role\n"; + cout << " role-policy get get the specified inline policy document embedded with the given role\n"; + cout << " role-policy delete remove policy attached to a role\n"; + cout << " role update update max_session_duration of a role\n"; + cout << " reshard add schedule a resharding of a bucket\n"; + cout << " reshard list list all bucket resharding or scheduled to be resharded\n"; + cout << " reshard status read bucket resharding status\n"; + cout << " reshard process process of scheduled reshard jobs\n"; + cout << " reshard cancel cancel resharding a bucket\n"; + cout << " reshard stale-instances list list stale-instances from bucket resharding\n"; cout << " reshard stale-instances delete cleanup stale-instances from bucket resharding\n"; - cout << " sync error list list sync error\n"; - cout << " sync error trim trim sync error\n"; - cout << " mfa create create a new MFA TOTP token\n"; - cout << " mfa list list MFA TOTP tokens\n"; - cout << " mfa get show MFA TOTP token\n"; - cout << " mfa remove delete MFA TOTP token\n"; - cout << " mfa check check MFA TOTP token\n"; - cout << " mfa resync re-sync MFA TOTP token\n"; - cout << " topic list list bucket notifications topics\n"; - cout << " topic get get a bucket notifications topic\n"; - cout << " topic rm remove a bucket notifications topic\n"; - cout << " topic stats get a bucket notifications persistent topic stats (i.e. reservations, entries & size)\n"; - cout << " script put upload a Lua script to a context\n"; - cout << " script get get the Lua script of a context\n"; - cout << " script rm remove the Lua scripts of a context\n"; - cout << " script-package add add a Lua package to the scripts allowlist\n"; - cout << " script-package rm remove a Lua package from the scripts allowlist\n"; - cout << " script-package list get the Lua packages allowlist\n"; - cout << " script-package reload install/remove Lua packages according to allowlist\n"; - cout << " notification list list bucket notifications configuration\n"; - cout << " notification get get a bucket notifications configuration\n"; - cout << " notification rm remove a bucket notifications configuration\n"; + cout << " sync error list list sync error\n"; + cout << " sync error trim trim sync error\n"; + cout << " mfa create create a new MFA TOTP token\n"; + cout << " mfa list list MFA TOTP tokens\n"; + cout << " mfa get show MFA TOTP token\n"; + cout << " mfa remove delete MFA TOTP token\n"; + cout << " mfa check check MFA TOTP token\n"; + cout << " mfa resync re-sync MFA TOTP token\n"; + cout << " topic list list bucket notifications topics\n"; + cout << " topic get get a bucket notifications topic\n"; + cout << " topic rm remove a bucket notifications topic\n"; + cout << " topic stats get a bucket notifications persistent topic stats (i.e. reservations, entries & size)\n"; + cout << " script put upload a Lua script to a context\n"; + cout << " script get get the Lua script of a context\n"; + cout << " script rm remove the Lua scripts of a context\n"; + cout << " script-package add add a Lua package to the scripts allowlist\n"; + cout << " script-package rm remove a Lua package from the scripts allowlist\n"; + cout << " script-package list get the Lua packages allowlist\n"; + cout << " script-package reload install/remove Lua packages according to allowlist\n"; + cout << " notification list list bucket notifications configuration\n"; + cout << " notification get get a bucket notifications configuration\n"; + cout << " notification rm remove a bucket notifications configuration\n"; cout << "options:\n"; - cout << " --tenant=<tenant> tenant name\n"; - cout << " --user_ns=<namespace> namespace of user (oidc in case of users authenticated with oidc provider)\n"; - cout << " --uid=<id> user id\n"; - cout << " --new-uid=<id> new user id\n"; - cout << " --subuser=<name> subuser name\n"; - cout << " --access-key=<key> S3 access key\n"; - cout << " --email=<email> user's email address\n"; - cout << " --secret/--secret-key=<key>\n"; - cout << " specify secret key\n"; - cout << " --gen-access-key generate random access key (for S3)\n"; - cout << " --gen-secret generate random secret key\n"; - cout << " --key-type=<type> key type, options are: swift, s3\n"; - cout << " --temp-url-key[-2]=<key> temp url key\n"; - cout << " --access=<access> Set access permissions for sub-user, should be one\n"; - cout << " of read, write, readwrite, full\n"; - cout << " --display-name=<name> user's display name\n"; - cout << " --max-buckets max number of buckets for a user\n"; - cout << " --admin set the admin flag on the user\n"; - cout << " --system set the system flag on the user\n"; - cout << " --op-mask set the op mask on the user\n"; - cout << " --bucket=<bucket> Specify the bucket name. Also used by the quota command.\n"; - cout << " --pool=<pool> Specify the pool name. Also used to scan for leaked rados objects.\n"; - cout << " --object=<object> object name\n"; - cout << " --objects-file=<file> file containing a list of object names to process\n"; - cout << " --object-version=<version> object version\n"; - cout << " --date=<date> date in the format yyyy-mm-dd\n"; - cout << " --start-date=<date> start date in the format yyyy-mm-dd\n"; - cout << " --end-date=<date> end date in the format yyyy-mm-dd\n"; - cout << " --bucket-id=<bucket-id> bucket id\n"; - cout << " --bucket-new-name=<bucket>\n"; - cout << " for bucket link: optional new name\n"; - cout << " --shard-id=<shard-id> optional for: \n"; - cout << " mdlog list\n"; - cout << " data sync status\n"; - cout << " required for: \n"; - cout << " mdlog trim\n"; - cout << " --gen=<gen-id> optional for: \n"; - cout << " bilog list\n"; - cout << " bilog trim\n"; - cout << " bilog status\n"; - cout << " --max-entries=<entries> max entries for listing operations\n"; - cout << " --metadata-key=<key> key to retrieve metadata from with metadata get\n"; - cout << " --remote=<remote> zone or zonegroup id of remote gateway\n"; - cout << " --period=<id> period id\n"; - cout << " --url=<url> url for pushing/pulling period/realm\n"; - cout << " --epoch=<number> period epoch\n"; - cout << " --commit commit the period during 'period update'\n"; - cout << " --staging get staging period info\n"; - cout << " --master set as master\n"; - cout << " --master-zone=<id> master zone id\n"; - cout << " --rgw-realm=<name> realm name\n"; - cout << " --realm-id=<id> realm id\n"; - cout << " --realm-new-name=<name> realm new name\n"; - cout << " --rgw-zonegroup=<name> zonegroup name\n"; - cout << " --zonegroup-id=<id> zonegroup id\n"; - cout << " --zonegroup-new-name=<name>\n"; - cout << " zonegroup new name\n"; - cout << " --rgw-zone=<name> name of zone in which radosgw is running\n"; - cout << " --zone-id=<id> zone id\n"; - cout << " --zone-new-name=<name> zone new name\n"; - cout << " --source-zone specify the source zone (for data sync)\n"; - cout << " --default set entity (realm, zonegroup, zone) as default\n"; - cout << " --read-only set zone as read-only (when adding to zonegroup)\n"; - cout << " --redirect-zone specify zone id to redirect when response is 404 (not found)\n"; - cout << " --placement-id placement id for zonegroup placement commands\n"; - cout << " --storage-class storage class for zonegroup placement commands\n"; - cout << " --tags=<list> list of tags for zonegroup placement add and modify commands\n"; - cout << " --tags-add=<list> list of tags to add for zonegroup placement modify command\n"; - cout << " --tags-rm=<list> list of tags to remove for zonegroup placement modify command\n"; - cout << " --endpoints=<list> zone endpoints\n"; - cout << " --index-pool=<pool> placement target index pool\n"; - cout << " --data-pool=<pool> placement target data pool\n"; - cout << " --data-extra-pool=<pool> placement target data extra (non-ec) pool\n"; - cout << " --placement-index-type=<type>\n"; - cout << " placement target index type (normal, indexless, or #id)\n"; - cout << " --placement-inline-data=<true>\n"; - cout << " set whether the placement target is configured to store a data\n"; - cout << " chunk inline in head objects\n"; - cout << " --compression=<type> placement target compression type (plugin name or empty/none)\n"; - cout << " --tier-type=<type> zone tier type\n"; - cout << " --tier-config=<k>=<v>[,...]\n"; - cout << " set zone tier config keys, values\n"; - cout << " --tier-config-rm=<k>[,...]\n"; - cout << " unset zone tier config keys\n"; - cout << " --sync-from-all[=false] set/reset whether zone syncs from all zonegroup peers\n"; - cout << " --sync-from=[zone-name][,...]\n"; - cout << " set list of zones to sync from\n"; - cout << " --sync-from-rm=[zone-name][,...]\n"; - cout << " remove zones from list of zones to sync from\n"; - cout << " --bucket-index-max-shards override a zone/zonegroup's default bucket index shard count\n"; - cout << " --fix besides checking bucket index, will also fix it\n"; - cout << " --check-objects bucket check: rebuilds bucket index according to\n"; - cout << " actual objects state\n"; - cout << " --format=<format> specify output format for certain operations: xml,\n"; - cout << " json\n"; - cout << " --purge-data when specified, user removal will also purge all the\n"; - cout << " user data\n"; - cout << " --purge-keys when specified, subuser removal will also purge all the\n"; - cout << " subuser keys\n"; - cout << " --purge-objects remove a bucket's objects before deleting it\n"; - cout << " (NOTE: required to delete a non-empty bucket)\n"; - cout << " --sync-stats option to 'user stats', update user stats with current\n"; - cout << " stats reported by user's buckets indexes\n"; - cout << " --reset-stats option to 'user stats', reset stats in accordance with user buckets\n"; - cout << " --show-config show configuration\n"; - cout << " --show-log-entries=<flag> enable/disable dump of log entries on log show\n"; - cout << " --show-log-sum=<flag> enable/disable dump of log summation on log show\n"; - cout << " --skip-zero-entries log show only dumps entries that don't have zero value\n"; - cout << " in one of the numeric field\n"; - cout << " --infile=<file> file to read in when setting data\n"; - cout << " --categories=<list> comma separated list of categories, used in usage show\n"; - cout << " --caps=<caps> list of caps (e.g., \"usage=read, write; user=read\")\n"; - cout << " --op-mask=<op-mask> permission of user's operations (e.g., \"read, write, delete, *\")\n"; - cout << " --yes-i-really-mean-it required for certain operations\n"; - cout << " --warnings-only when specified with bucket limit check, list\n"; - cout << " only buckets nearing or over the current max\n"; - cout << " objects per shard value\n"; - cout << " --bypass-gc when specified with bucket deletion, triggers\n"; - cout << " object deletions by not involving GC\n"; - cout << " --inconsistent-index when specified with bucket deletion and bypass-gc set to true,\n"; - cout << " ignores bucket index consistency\n"; - cout << " --min-rewrite-size min object size for bucket rewrite (default 4M)\n"; - cout << " --max-rewrite-size max object size for bucket rewrite (default ULLONG_MAX)\n"; - cout << " --min-rewrite-stripe-size min stripe size for object rewrite (default 0)\n"; - cout << " --trim-delay-ms time interval in msec to limit the frequency of sync error log entries trimming operations,\n"; - cout << " the trimming process will sleep the specified msec for every 1000 entries trimmed\n"; - cout << " --max-concurrent-ios maximum concurrent ios for bucket operations (default: 32)\n"; - cout << " --enable-feature enable a zone/zonegroup feature\n"; - cout << " --disable-feature disable a zone/zonegroup feature\n"; + cout << " --tenant=<tenant> tenant name\n"; + cout << " --user_ns=<namespace> namespace of user (oidc in case of users authenticated with oidc provider)\n"; + cout << " --uid=<id> user id\n"; + cout << " --new-uid=<id> new user id\n"; + cout << " --subuser=<name> subuser name\n"; + cout << " --access-key=<key> S3 access key\n"; + cout << " --email=<email> user's email address\n"; + cout << " --secret/--secret-key=<key> specify secret key\n"; + cout << " --gen-access-key generate random access key (for S3)\n"; + cout << " --gen-secret generate random secret key\n"; + cout << " --key-type=<type> key type, options are: swift, s3\n"; + cout << " --temp-url-key[-2]=<key> temp url key\n"; + cout << " --access=<access> Set access permissions for sub-user, should be one\n"; + cout << " of read, write, readwrite, full\n"; + cout << " --display-name=<name> user's display name\n"; + cout << " --max-buckets max number of buckets for a user\n"; + cout << " --admin set the admin flag on the user\n"; + cout << " --system set the system flag on the user\n"; + cout << " --op-mask set the op mask on the user\n"; + cout << " --bucket=<bucket> Specify the bucket name. Also used by the quota command.\n"; + cout << " --pool=<pool> Specify the pool name. Also used to scan for leaked rados objects.\n"; + cout << " --object=<object> object name\n"; + cout << " --objects-file=<file> file containing a list of object names to process\n"; + cout << " --object-version=<version> object version\n"; + cout << " --date=<date> date in the format yyyy-mm-dd\n"; + cout << " --start-date=<date> start date in the format yyyy-mm-dd\n"; + cout << " --end-date=<date> end date in the format yyyy-mm-dd\n"; + cout << " --bucket-id=<bucket-id> bucket id\n"; + cout << " --bucket-new-name=<bucket> for bucket link: optional new name\n"; + cout << " --shard-id=<shard-id> optional for:\n"; + cout << " mdlog list\n"; + cout << " data sync status\n"; + cout << " required for:\n"; + cout << " mdlog trim\n"; + cout << " --gen=<gen-id> optional for:\n"; + cout << " bilog list\n"; + cout << " bilog trim\n"; + cout << " bilog status\n"; + cout << " --max-entries=<entries> max entries for listing operations\n"; + cout << " --metadata-key=<key> key to retrieve metadata from with metadata get\n"; + cout << " --remote=<remote> zone or zonegroup id of remote gateway\n"; + cout << " --period=<id> period id\n"; + cout << " --url=<url> url for pushing/pulling period/realm\n"; + cout << " --epoch=<number> period epoch\n"; + cout << " --commit commit the period during 'period update'\n"; + cout << " --staging get staging period info\n"; + cout << " --master set as master\n"; + cout << " --master-zone=<id> master zone id\n"; + cout << " --rgw-realm=<name> realm name\n"; + cout << " --realm-id=<id> realm id\n"; + cout << " --realm-new-name=<name> realm new name\n"; + cout << " --rgw-zonegroup=<name> zonegroup name\n"; + cout << " --zonegroup-id=<id> zonegroup id\n"; + cout << " --zonegroup-new-name=<name> zonegroup new name\n"; + cout << " --rgw-zone=<name> name of zone in which radosgw is running\n"; + cout << " --zone-id=<id> zone id\n"; + cout << " --zone-new-name=<name> zone new name\n"; + cout << " --source-zone specify the source zone (for data sync)\n"; + cout << " --default set entity (realm, zonegroup, zone) as default\n"; + cout << " --read-only set zone as read-only (when adding to zonegroup)\n"; + cout << " --redirect-zone specify zone id to redirect when response is 404 (not found)\n"; + cout << " --placement-id placement id for zonegroup placement commands\n"; + cout << " --storage-class storage class for zonegroup placement commands\n"; + cout << " --tags=<list> list of tags for zonegroup placement add and modify commands\n"; + cout << " --tags-add=<list> list of tags to add for zonegroup placement modify command\n"; + cout << " --tags-rm=<list> list of tags to remove for zonegroup placement modify command\n"; + cout << " --endpoints=<list> zone endpoints\n"; + cout << " --index-pool=<pool> placement target index pool\n"; + cout << " --data-pool=<pool> placement target data pool\n"; + cout << " --data-extra-pool=<pool> placement target data extra (non-ec) pool\n"; + cout << " --placement-index-type=<type> placement target index type (normal, indexless, or #id)\n"; + cout << " --placement-inline-data=<true> set whether the placement target is configured to store a data\n"; + cout << " chunk inline in head objects\n"; + cout << " --compression=<type> placement target compression type (plugin name or empty/none)\n"; + cout << " --tier-type=<type> zone tier type\n"; + cout << " --tier-config=<k>=<v>[,...] set zone tier config keys, values\n"; + cout << " --tier-config-rm=<k>[,...] unset zone tier config keys\n"; + cout << " --sync-from-all[=false] set/reset whether zone syncs from all zonegroup peers\n"; + cout << " --sync-from=[zone-name][,...] set list of zones to sync from\n"; + cout << " --sync-from-rm=[zone-name][,...] remove zones from list of zones to sync from\n"; + cout << " --bucket-index-max-shards override a zone/zonegroup's default bucket index shard count\n"; + cout << " --fix besides checking bucket index, will also fix it\n"; + cout << " --check-objects bucket check: rebuilds bucket index according to actual objects state\n"; + cout << " --format=<format> specify output format for certain operations: xml, json\n"; + cout << " --purge-data when specified, user removal will also purge all the\n"; + cout << " user data\n"; + cout << " --purge-keys when specified, subuser removal will also purge all the\n"; + cout << " subuser keys\n"; + cout << " --purge-objects remove a bucket's objects before deleting it\n"; + cout << " (NOTE: required to delete a non-empty bucket)\n"; + cout << " --sync-stats option to 'user stats', update user stats with current\n"; + cout << " stats reported by user's buckets indexes\n"; + cout << " --reset-stats option to 'user stats', reset stats in accordance with user buckets\n"; + cout << " --show-config show configuration\n"; + cout << " --show-log-entries=<flag> enable/disable dump of log entries on log show\n"; + cout << " --show-log-sum=<flag> enable/disable dump of log summation on log show\n"; + cout << " --skip-zero-entries log show only dumps entries that don't have zero value\n"; + cout << " in one of the numeric field\n"; + cout << " --infile=<file> file to read in when setting data\n"; + cout << " --categories=<list> comma separated list of categories, used in usage show\n"; + cout << " --caps=<caps> list of caps (e.g., \"usage=read, write; user=read\")\n"; + cout << " --op-mask=<op-mask> permission of user's operations (e.g., \"read, write, delete, *\")\n"; + cout << " --yes-i-really-mean-it required for certain operations\n"; + cout << " --warnings-only when specified with bucket limit check, list\n"; + cout << " only buckets nearing or over the current max\n"; + cout << " objects per shard value\n"; + cout << " --bypass-gc when specified with bucket deletion, triggers\n"; + cout << " object deletions by not involving GC\n"; + cout << " --inconsistent-index when specified with bucket deletion and bypass-gc set to true,\n"; + cout << " ignores bucket index consistency\n"; + cout << " --min-rewrite-size min object size for bucket rewrite (default 4M)\n"; + cout << " --max-rewrite-size max object size for bucket rewrite (default ULLONG_MAX)\n"; + cout << " --min-rewrite-stripe-size min stripe size for object rewrite (default 0)\n"; + cout << " --trim-delay-ms time interval in msec to limit the frequency of sync error log entries trimming operations,\n"; + cout << " the trimming process will sleep the specified msec for every 1000 entries trimmed\n"; + cout << " --max-concurrent-ios maximum concurrent ios for bucket operations (default: 32)\n"; + cout << " --enable-feature enable a zone/zonegroup feature\n"; + cout << " --disable-feature disable a zone/zonegroup feature\n"; cout << "\n"; cout << "<date> := \"YYYY-MM-DD[ hh:mm:ss]\"\n"; cout << "\nQuota options:\n"; - cout << " --max-objects specify max objects (negative value to disable)\n"; - cout << " --max-size specify max size (in B/K/M/G/T, negative value to disable)\n"; - cout << " --quota-scope scope of quota (bucket, user)\n"; + cout << " --max-objects specify max objects (negative value to disable)\n"; + cout << " --max-size specify max size (in B/K/M/G/T, negative value to disable)\n"; + cout << " --quota-scope scope of quota (bucket, user)\n"; cout << "\nRate limiting options:\n"; - cout << " --max-read-ops specify max requests per minute for READ ops per RGW (GET and HEAD request methods), 0 means unlimited\n"; - cout << " --max-read-bytes specify max bytes per minute for READ ops per RGW (GET and HEAD request methods), 0 means unlimited\n"; - cout << " --max-write-ops specify max requests per minute for WRITE ops per RGW (Not GET or HEAD request methods), 0 means unlimited\n"; - cout << " --max-write-bytes specify max bytes per minute for WRITE ops per RGW (Not GET or HEAD request methods), 0 means unlimited\n"; - cout << " --ratelimit-scope scope of rate limiting: bucket, user, anonymous\n"; - cout << " anonymous can be configured only with global rate limit\n"; + cout << " --max-read-ops specify max requests per minute for READ ops per RGW (GET and HEAD request methods), 0 means unlimited\n"; + cout << " --max-read-bytes specify max bytes per minute for READ ops per RGW (GET and HEAD request methods), 0 means unlimited\n"; + cout << " --max-write-ops specify max requests per minute for WRITE ops per RGW (Not GET or HEAD request methods), 0 means unlimited\n"; + cout << " --max-write-bytes specify max bytes per minute for WRITE ops per RGW (Not GET or HEAD request methods), 0 means unlimited\n"; + cout << " --ratelimit-scope scope of rate limiting: bucket, user, anonymous\n"; + cout << " anonymous can be configured only with global rate limit\n"; cout << "\nOrphans search options:\n"; - cout << " --num-shards num of shards to use for keeping the temporary scan info\n"; - cout << " --orphan-stale-secs num of seconds to wait before declaring an object to be an orphan (default: 86400)\n"; - cout << " --job-id set the job id (for orphans find)\n"; - cout << " --detail detailed mode, log and stat head objects as well\n"; + cout << " --num-shards num of shards to use for keeping the temporary scan info\n"; + cout << " --orphan-stale-secs num of seconds to wait before declaring an object to be an orphan (default: 86400)\n"; + cout << " --job-id set the job id (for orphans find)\n"; + cout << " --detail detailed mode, log and stat head objects as well\n"; cout << "\nOrphans list-jobs options:\n"; - cout << " --extra-info provide extra info in job list\n"; + cout << " --extra-info provide extra info in job list\n"; cout << "\nRole options:\n"; - cout << " --role-name name of the role to create\n"; - cout << " --path path to the role\n"; - cout << " --assume-role-policy-doc the trust relationship policy document that grants an entity permission to assume the role\n"; - cout << " --policy-name name of the policy document\n"; - cout << " --policy-doc permission policy document\n"; - cout << " --path-prefix path prefix for filtering roles\n"; + cout << " --role-name name of the role to create\n"; + cout << " --path path to the role\n"; + cout << " --assume-role-policy-doc the trust relationship policy document that grants an entity permission to assume the role\n"; + cout << " --policy-name name of the policy document\n"; + cout << " --policy-doc permission policy document\n"; + cout << " --path-prefix path prefix for filtering roles\n"; cout << "\nMFA options:\n"; - cout << " --totp-serial a string that represents the ID of a TOTP token\n"; - cout << " --totp-seed the secret seed that is used to calculate the TOTP\n"; - cout << " --totp-seconds the time resolution that is being used for TOTP generation\n"; - cout << " --totp-window the number of TOTP tokens that are checked before and after the current token when validating token\n"; - cout << " --totp-pin the valid value of a TOTP token at a certain time\n"; + cout << " --totp-serial a string that represents the ID of a TOTP token\n"; + cout << " --totp-seed the secret seed that is used to calculate the TOTP\n"; + cout << " --totp-seconds the time resolution that is being used for TOTP generation\n"; + cout << " --totp-window the number of TOTP tokens that are checked before and after the current token when validating token\n"; + cout << " --totp-pin the valid value of a TOTP token at a certain time\n"; cout << "\nBucket notifications options:\n"; - cout << " --topic bucket notifications topic name\n"; - cout << " --notification-id bucket notifications id\n"; + cout << " --topic bucket notifications topic name\n"; + cout << " --notification-id bucket notifications id\n"; cout << "\nScript options:\n"; - cout << " --context context in which the script runs. one of: "+LUA_CONTEXT_LIST+"\n"; - cout << " --package name of the Lua package that should be added/removed to/from the allowlist\n"; - cout << " --allow-compilation package is allowed to compile C code as part of its installation\n"; + cout << " --context context in which the script runs. one of: "+LUA_CONTEXT_LIST+"\n"; + cout << " --package name of the Lua package that should be added/removed to/from the allowlist\n"; + cout << " --allow-compilation package is allowed to compile C code as part of its installation\n"; cout << "\nBucket check olh/unlinked options:\n"; - cout << " --min-age-hours minimum age of unlinked objects to consider for bucket check unlinked (default: 1)\n"; - cout << " --dump-keys when specified, all keys identified as problematic are printed to stdout\n"; - cout << " --hide-progress when specified, per-shard progress details are not printed to stderr\n"; + cout << " --min-age-hours minimum age of unlinked objects to consider for bucket check unlinked (default: 1)\n"; + cout << " --dump-keys when specified, all keys identified as problematic are printed to stdout\n"; + cout << " --hide-progress when specified, per-shard progress details are not printed to stderr\n"; cout << "\nradoslist options:\n"; - cout << " --rgw-obj-fs the field separator that will separate the rados\n"; - cout << " object name from the rgw object name;\n"; - cout << " additionally rados objects for incomplete\n"; - cout << " multipart uploads will not be output\n"; + cout << " --rgw-obj-fs the field separator that will separate the rados object name from the rgw object name;\n"; + cout << " additionally rados objects for incomplete multipart uploads will not be output\n"; cout << "\n"; generic_client_usage(); } @@ -687,9 +671,6 @@ enum class OPT { BUCKET_OBJECT_SHARD, BUCKET_RESYNC_ENCRYPTED_MULTIPART, POLICY, - POOL_ADD, - POOL_RM, - POOLS_LIST, LOG_LIST, LOG_SHOW, LOG_RM, @@ -911,10 +892,6 @@ static SimpleCmd::Commands all_cmds = { { "bucket object shard", OPT::BUCKET_OBJECT_SHARD }, { "bucket resync encrypted multipart", OPT::BUCKET_RESYNC_ENCRYPTED_MULTIPART }, { "policy", OPT::POLICY }, - { "pool add", OPT::POOL_ADD }, - { "pool rm", OPT::POOL_RM }, - { "pool list", OPT::POOLS_LIST }, - { "pools list", OPT::POOLS_LIST }, { "log list", OPT::LOG_LIST }, { "log show", OPT::LOG_SHOW }, { "log rm", OPT::LOG_RM }, @@ -1197,20 +1174,19 @@ public: } }; -static int init_bucket(rgw::sal::User* user, const rgw_bucket& b, +static int init_bucket(const rgw_bucket& b, std::unique_ptr<rgw::sal::Bucket>* bucket) { - return driver->get_bucket(dpp(), user, b, bucket, null_yield); + return driver->load_bucket(dpp(), b, bucket, null_yield); } -static int init_bucket(rgw::sal::User* user, - const string& tenant_name, +static int init_bucket(const string& tenant_name, const string& bucket_name, const string& bucket_id, std::unique_ptr<rgw::sal::Bucket>* bucket) { rgw_bucket b{tenant_name, bucket_name, bucket_id}; - return init_bucket(user, b, bucket); + return init_bucket(b, bucket); } static int read_input(const string& infile, bufferlist& bl) @@ -1415,7 +1391,8 @@ int set_bucket_quota(rgw::sal::Driver* driver, OPT opt_cmd, bool have_max_size, bool have_max_objects) { std::unique_ptr<rgw::sal::Bucket> bucket; - int r = driver->get_bucket(dpp(), nullptr, tenant_name, bucket_name, &bucket, null_yield); + int r = driver->load_bucket(dpp(), rgw_bucket(tenant_name, bucket_name), + &bucket, null_yield); if (r < 0) { cerr << "could not get bucket info for bucket=" << bucket_name << ": " << cpp_strerror(-r) << std::endl; return -r; @@ -1439,7 +1416,8 @@ int set_bucket_ratelimit(rgw::sal::Driver* driver, OPT opt_cmd, bool have_max_read_bytes, bool have_max_write_bytes) { std::unique_ptr<rgw::sal::Bucket> bucket; - int r = driver->get_bucket(dpp(), nullptr, tenant_name, bucket_name, &bucket, null_yield); + int r = driver->load_bucket(dpp(), rgw_bucket(tenant_name, bucket_name), + &bucket, null_yield); if (r < 0) { cerr << "could not get bucket info for bucket=" << bucket_name << ": " << cpp_strerror(-r) << std::endl; return -r; @@ -1542,7 +1520,8 @@ int show_bucket_ratelimit(rgw::sal::Driver* driver, const string& tenant_name, const string& bucket_name, Formatter *formatter) { std::unique_ptr<rgw::sal::Bucket> bucket; - int r = driver->get_bucket(dpp(), nullptr, tenant_name, bucket_name, &bucket, null_yield); + int r = driver->load_bucket(dpp(), rgw_bucket(tenant_name, bucket_name), + &bucket, null_yield); if (r < 0) { cerr << "could not get bucket info for bucket=" << bucket_name << ": " << cpp_strerror(-r) << std::endl; return -r; @@ -1726,7 +1705,7 @@ int do_check_object_locator(const string& tenant_name, const string& bucket_name f->open_object_section("bucket"); f->dump_string("bucket", bucket_name); - int ret = init_bucket(nullptr, tenant_name, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant_name, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return ret; @@ -2043,12 +2022,11 @@ static int update_period(rgw::sal::ConfigStore* cfgstore, return 0; } -static int init_bucket_for_sync(rgw::sal::User* user, - const string& tenant, const string& bucket_name, +static int init_bucket_for_sync(const string& tenant, const string& bucket_name, const string& bucket_id, std::unique_ptr<rgw::sal::Bucket>* bucket) { - int ret = init_bucket(user, tenant, bucket_name, bucket_id, bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return ret; @@ -2121,7 +2099,7 @@ stringstream& push_ss(stringstream& ss, list<string>& l, int tab = 0) static void get_md_sync_status(list<string>& status) { - RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor()); + RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor); int ret = sync.init(dpp()); if (ret < 0) { @@ -2277,7 +2255,7 @@ static void get_data_sync_status(const rgw_zone_id& source_zone, list<string>& s flush_ss(ss, status); return; } - RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor(), source_zone, nullptr); + RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor, source_zone, nullptr); int ret = sync.init(dpp()); if (ret < 0) { @@ -2409,7 +2387,7 @@ static void get_data_sync_status(const rgw_zone_id& source_zone, list<string>& s push_ss(ss, status, tab) << "data is caught up with source"; } else if (total_behind > 0) { push_ss(ss, status, tab) << "data is behind on " << total_behind << " shards"; - push_ss(ss, status, tab) << "behind shards: " << "[" << shards_behind_set << "]" ; + push_ss(ss, status, tab) << "behind shards: " << "[" << shards_behind_set << "]"; if (oldest) { push_ss(ss, status, tab) << "oldest incremental change not applied: " << oldest->second << " [" << oldest->first << ']'; @@ -2524,7 +2502,7 @@ static int bucket_source_sync_status(const DoutPrefixProvider *dpp, rgw::sal::Ra } std::unique_ptr<rgw::sal::Bucket> source_bucket; - int r = init_bucket(nullptr, *pipe.source.bucket, &source_bucket); + int r = init_bucket(*pipe.source.bucket, &source_bucket); if (r < 0) { ldpp_dout(dpp, -1) << "failed to read source bucket info: " << cpp_strerror(r) << dendl; return r; @@ -2618,7 +2596,7 @@ static int bucket_source_sync_status(const DoutPrefixProvider *dpp, rgw::sal::Ra } if (!shards_behind.empty()) { out << indented{width} << "bucket is behind on " << shards_behind.size() << " shards\n"; - out << indented{width} << "behind shards: [" << shards_behind << "]\n" ; + out << indented{width} << "behind shards: [" << shards_behind << "]\n"; } else { out << indented{width} << "bucket is caught up with source\n"; } @@ -2653,7 +2631,7 @@ static void get_hint_entities(const std::set<rgw_zone_id>& zones, const std::set for (auto& zone_id : zones) { for (auto& b : buckets) { std::unique_ptr<rgw::sal::Bucket> hint_bucket; - int ret = init_bucket(nullptr, b, &hint_bucket); + int ret = init_bucket(b, &hint_bucket); if (ret < 0) { ldpp_dout(dpp(), 20) << "could not init bucket info for hint bucket=" << b << " ... skipping" << dendl; continue; @@ -2696,7 +2674,7 @@ static int sync_info(std::optional<rgw_zone_id> opt_target_zone, std::optional<r if (eff_bucket) { std::unique_ptr<rgw::sal::Bucket> bucket; - int ret = init_bucket(nullptr, *eff_bucket, &bucket); + int ret = init_bucket(*eff_bucket, &bucket); if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: init_bucket failed: " << cpp_strerror(-ret) << std::endl; return ret; @@ -2893,11 +2871,11 @@ static int bucket_sync_status(rgw::sal::Driver* driver, const RGWBucketInfo& inf for (auto& zone_id : zone_ids) { auto z = static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->get_zonegroup().zones.find(zone_id.id); - if (z == static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->get_zonegroup().zones.end()) { /* should't happen */ + if (z == static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->get_zonegroup().zones.end()) { /* shouldn't happen */ continue; } auto c = zone_conn_map.find(zone_id.id); - if (c == zone_conn_map.end()) { /* should't happen */ + if (c == zone_conn_map.end()) { /* shouldn't happen */ continue; } @@ -3000,12 +2978,20 @@ int check_reshard_bucket_params(rgw::sal::Driver* driver, return -EINVAL; } - int ret = init_bucket(nullptr, tenant, bucket_name, bucket_id, bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return ret; } + if (! is_layout_reshardable((*bucket)->get_info().layout)) { + std::cerr << "Bucket '" << (*bucket)->get_name() << + "' currently has layout '" << + current_layout_desc((*bucket)->get_info().layout) << + "', which does not support resharding." << std::endl; + return -EINVAL; + } + int num_source_shards = rgw::current_num_shards((*bucket)->get_info().layout); if (num_shards <= num_source_shards && !yes_i_really_mean_it) { @@ -3032,19 +3018,20 @@ static int scan_totp(CephContext *cct, ceph::real_time& now, rados::cls::otp::ot uint32_t max_skew = MAX_TOTP_SKEW_HOURS * 3600; while (time_ofs_abs < max_skew) { + // coverity supression: oath_totp_validate2 is an external library function, cannot fix internally + // Further, step_size is a small number and unlikely to overflow int rc = oath_totp_validate2(totp.seed_bin.c_str(), totp.seed_bin.length(), start_time, + // coverity[store_truncates_time_t:SUPPRESS] step_size, time_ofs, 1, nullptr, pins[0].c_str()); if (rc != OATH_INVALID_OTP) { - // oath_totp_validate2 is an external library function, cannot fix internally - // Further, step_size is a small number and unlikely to overflow - // coverity[store_truncates_time_t:SUPPRESS] rc = oath_totp_validate2(totp.seed_bin.c_str(), totp.seed_bin.length(), start_time, + // coverity[store_truncates_time_t:SUPPRESS] step_size, time_ofs - step_size, /* smaller time_ofs moves time forward */ 1, @@ -3174,7 +3161,7 @@ public: return 0; } - ret = init_bucket(nullptr, *b, &bucket); + ret = init_bucket(*b, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return ret; @@ -6707,7 +6694,8 @@ int main(int argc, const char **argv) cerr << "failed to parse policy: " << e.what() << std::endl; return -EINVAL; } - std::unique_ptr<rgw::sal::RGWRole> role = driver->get_role(role_name, tenant, path, assume_role_doc); + std::unique_ptr<rgw::sal::RGWRole> role = driver->get_role(role_name, tenant, path, + assume_role_doc, max_session_duration); ret = role->create(dpp(), true, "", null_yield); if (ret < 0) { return -ret; @@ -6917,11 +6905,11 @@ int main(int argc, const char **argv) if (ret < 0) { return -ret; } + role->update_max_session_duration(max_session_duration); if (!role->validate_max_session_duration(dpp())) { ret = -EINVAL; return ret; } - role->update_max_session_duration(max_session_duration); ret = role->update(dpp(), null_yield); if (ret < 0) { return -ret; @@ -7015,7 +7003,7 @@ int main(int argc, const char **argv) bucket_op.marker = marker; RGWBucketAdminOp::info(driver, bucket_op, stream_flusher, null_yield, dpp()); } else { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7108,7 +7096,7 @@ int main(int argc, const char **argv) cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -7222,7 +7210,7 @@ int main(int argc, const char **argv) cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -7407,47 +7395,6 @@ next: } } - if (opt_cmd == OPT::POOL_ADD) { - if (pool_name.empty()) { - cerr << "need to specify pool to add!" << std::endl; - exit(1); - } - - int ret = static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->add_bucket_placement(dpp(), pool, null_yield); - if (ret < 0) - cerr << "failed to add bucket placement: " << cpp_strerror(-ret) << std::endl; - } - - if (opt_cmd == OPT::POOL_RM) { - if (pool_name.empty()) { - cerr << "need to specify pool to remove!" << std::endl; - exit(1); - } - - int ret = static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->remove_bucket_placement(dpp(), pool, null_yield); - if (ret < 0) - cerr << "failed to remove bucket placement: " << cpp_strerror(-ret) << std::endl; - } - - if (opt_cmd == OPT::POOLS_LIST) { - set<rgw_pool> pools; - int ret = static_cast<rgw::sal::RadosStore*>(driver)->svc()->zone->list_placement_set(dpp(), pools, null_yield); - if (ret < 0) { - cerr << "could not list placement set: " << cpp_strerror(-ret) << std::endl; - return -ret; - } - formatter->reset(); - formatter->open_array_section("pools"); - for (auto siter = pools.begin(); siter != pools.end(); ++siter) { - formatter->open_object_section("pool"); - formatter->dump_string("name", siter->to_str()); - formatter->close_section(); - } - formatter->close_section(); - formatter->flush(cout); - cout << std::endl; - } - if (opt_cmd == OPT::USAGE_SHOW) { uint64_t start_epoch = 0; uint64_t end_epoch = (uint64_t)-1; @@ -7471,7 +7418,7 @@ next: if (!bucket_name.empty()) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7515,7 +7462,7 @@ next: } if (!bucket_name.empty()) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7554,7 +7501,7 @@ next: } if (opt_cmd == OPT::OLH_GET) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7571,7 +7518,7 @@ next: } if (opt_cmd == OPT::OLH_READLOG) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7609,7 +7556,7 @@ next: cerr << "ERROR: object not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7635,7 +7582,7 @@ next: cerr << "ERROR: bucket name not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7663,9 +7610,10 @@ next: return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { - cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; + ldpp_dout(dpp(), 0) << "ERROR: could not init bucket: " << cpp_strerror(-ret) << + dendl; return -ret; } @@ -7685,22 +7633,22 @@ next: int i = (specified_shard_id ? shard_id : 0); for (; i < max_shards; i++) { ldpp_dout(dpp(), 20) << "INFO: " << __func__ << ": starting shard=" << i << dendl; + marker.clear(); RGWRados::BucketShard bs(static_cast<rgw::sal::RadosStore*>(driver)->getRados()); int ret = bs.init(dpp(), bucket->get_info(), index, i, null_yield); - marker.clear(); - if (ret < 0) { - cerr << "ERROR: bs.init(bucket=" << bucket << ", shard=" << i << "): " << cpp_strerror(-ret) << std::endl; + ldpp_dout(dpp(), 0) << "ERROR: bs.init(bucket=" << bucket << ", shard=" << i << + "): " << cpp_strerror(-ret) << dendl; return -ret; } do { entries.clear(); - // if object is specified, we use that as a filter to only retrieve some some entries + // if object is specified, we use that as a filter to only retrieve some entries ret = static_cast<rgw::sal::RadosStore*>(driver)->getRados()->bi_list(bs, object, marker, max_entries, &entries, &is_truncated, null_yield); if (ret < 0) { - cerr << "ERROR: bi_list(): " << cpp_strerror(-ret) << std::endl; + ldpp_dout(dpp(), 0) << "ERROR: bi_list(): " << cpp_strerror(-ret) << dendl; return -ret; } ldpp_dout(dpp(), 20) << "INFO: " << __func__ << @@ -7732,14 +7680,14 @@ next: cerr << "ERROR: bucket name not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; } std::unique_ptr<rgw::sal::Bucket> cur_bucket; - ret = init_bucket(user.get(), tenant, bucket_name, string(), &cur_bucket); + ret = init_bucket(tenant, bucket_name, string(), &cur_bucket); if (ret == -ENOENT) { // no bucket entrypoint } else if (ret < 0) { @@ -7817,7 +7765,7 @@ next: } if (opt_cmd == OPT::OBJECT_RM) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7841,7 +7789,7 @@ next: return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -7884,7 +7832,7 @@ next: return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << "." << std::endl; @@ -7977,7 +7925,7 @@ next: return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -8108,7 +8056,8 @@ next: "have the resharding feature enabled." << std::endl; return ENOTSUP; } - if (!RGWBucketReshard::can_reshard(bucket->get_info(), zone_svc) && + + if (!RGWBucketReshard::should_zone_reshard_now(bucket->get_info(), zone_svc) && !yes_i_really_mean_it) { std::cerr << "Bucket '" << bucket->get_name() << "' already has too many " "log generations (" << bucket->get_info().layout.logs.size() << ") " @@ -8218,7 +8167,7 @@ next: return EINVAL; } - ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -8255,7 +8204,7 @@ next: } bool bucket_initable = true; - ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { if (yes_i_really_mean_it) { bucket_initable = false; @@ -8317,7 +8266,7 @@ next: } // OPT_RESHARD_CANCEL if (opt_cmd == OPT::OBJECT_UNLINK) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -8337,7 +8286,7 @@ next: } if (opt_cmd == OPT::OBJECT_STAT) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -8543,7 +8492,7 @@ next: } RGWLifecycleConfiguration config; - ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -8569,7 +8518,7 @@ next: if (opt_cmd == OPT::LC_PROCESS) { if ((! bucket_name.empty()) || (! bucket_id.empty())) { - int ret = init_bucket(nullptr, tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; @@ -8730,7 +8679,7 @@ next: if (sync_stats) { if (!bucket_name.empty()) { - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -9050,7 +8999,7 @@ next: } if (opt_cmd == OPT::METADATA_SYNC_STATUS) { - RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor()); + RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor); int ret = sync.init(dpp()); if (ret < 0) { @@ -9094,7 +9043,7 @@ next: } if (opt_cmd == OPT::METADATA_SYNC_INIT) { - RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor()); + RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor); int ret = sync.init(dpp()); if (ret < 0) { @@ -9110,7 +9059,7 @@ next: if (opt_cmd == OPT::METADATA_SYNC_RUN) { - RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor()); + RGWMetaSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor); int ret = sync.init(dpp()); if (ret < 0) { @@ -9130,7 +9079,7 @@ next: cerr << "ERROR: source zone not specified" << std::endl; return EINVAL; } - RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor(), source_zone, nullptr); + RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor, source_zone, nullptr); int ret = sync.init(dpp()); if (ret < 0) { @@ -9200,7 +9149,7 @@ next: return EINVAL; } - RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor(), source_zone, nullptr); + RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor, source_zone, nullptr); int ret = sync.init(dpp()); if (ret < 0) { @@ -9229,7 +9178,7 @@ next: return ret; } - RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->rados->get_async_processor(), source_zone, nullptr, sync_module); + RGWDataSyncStatusManager sync(static_cast<rgw::sal::RadosStore*>(driver), static_cast<rgw::sal::RadosStore*>(driver)->svc()->async_processor, source_zone, nullptr, sync_module); ret = sync.init(dpp()); if (ret < 0) { @@ -9253,7 +9202,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket_for_sync(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket_for_sync(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -9261,7 +9210,7 @@ next: if (opt_sb && opt_sb->bucket_id.empty()) { string sbid; std::unique_ptr<rgw::sal::Bucket> sbuck; - int ret = init_bucket_for_sync(user.get(), opt_sb->tenant, opt_sb->name, sbid, &sbuck); + int ret = init_bucket_for_sync(opt_sb->tenant, opt_sb->name, sbid, &sbuck); if (ret < 0) { return -ret; } @@ -9292,7 +9241,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -9344,7 +9293,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -9356,7 +9305,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -9372,7 +9321,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket_for_sync(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket_for_sync(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -9405,7 +9354,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket_for_sync(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket_for_sync(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { return -ret; } @@ -9430,7 +9379,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -9573,13 +9522,16 @@ next: return -EINVAL; } if (!start_marker.empty()) { - std::cerr << "end-date not allowed." << std::endl; + std::cerr << "start-marker not allowed." << std::endl; return -EINVAL; } if (!end_marker.empty()) { - std::cerr << "end-date not allowed." << std::endl; + std::cerr << "end_marker not allowed." << std::endl; return -EINVAL; } + if (marker.empty()) { + marker = "9"; // trims everything + } if (shard_id < 0) { shard_id = 0; @@ -9937,7 +9889,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -9960,7 +9912,7 @@ next: cerr << "ERROR: bucket not specified" << std::endl; return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -10545,7 +10497,7 @@ next: RGWPubSub ps(driver, tenant); rgw_pubsub_bucket_topics result; - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -10612,7 +10564,7 @@ next: return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; @@ -10666,7 +10618,7 @@ next: return EINVAL; } - int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket); + int ret = init_bucket(tenant, bucket_name, bucket_id, &bucket); if (ret < 0) { cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl; return -ret; |