Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11880. Intermediate subcommands do not need to implement Callable #7617

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

Intermediate subcommands (ones that only group other subcommands) do not need to implement Callable. Currently they show "missing subcommand" error as action. The same can be achieved by using picocli built-in behavior.

https://issues.apache.org/jira/browse/HDDS-11880

How was this patch tested?

Ran some of these without subcommands:

$ ozone admin cert
Missing required subcommand
Usage: ozone admin cert [-hV] [COMMAND]
Certificate related operations
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  info   Show detailed information for a specific certificate
  list   List certificates
  clean  Clean expired certificates from the SCM metadata.


$ ozone admin container
Missing required subcommand
Usage: ozone admin container [-hV] [COMMAND]
Container specific operations
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  list     List containers
  info     Show information about a specific container
  create   Create container
  close    close container
  report   Display the container summary report
  upgrade  Offline upgrade all schema V2 containers to schema V3 for this
             datanode.


$ ozone admin replicationmanager
Missing required subcommand
Usage: ozone admin replicationmanager [-hV] [COMMAND]
ReplicationManager specific operations
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  start   Start ReplicationManager
  stop    Stop ReplicationManager
  status  Check if ReplicationManager is running or not


$ ozone debug container
Missing required subcommand
Usage: ozone debug container [-hV] [COMMAND]
Container replica specific operations to be executed on datanodes only
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  list     Show container info of all container replicas on datanode
  info     Show container info of a container replica on datanode
  export   Export one container to a tarball
  inspect  Check the metadata of all container replicas on this datanode.


$ ozone sh bucket
Missing required subcommand
Usage: ozone sh bucket [-hV] [COMMAND]
Bucket specific operations
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  info                    returns information about a bucket
  list, ls                lists the buckets in a volume.
  create                  creates a bucket in a given volume
  setquota                Set quota of the buckets. At least one of the quota
                            set flag is mandatory.
  link                    creates a symlink to another bucket
  delete                  deletes a bucket
  addacl                  Add one or more new ACLs.
  removeacl               Remove one or more existing ACLs.
  getacl                  List all ACLs.
  setacl                  Set one or more ACLs, replacing the existing ones.
  clrquota                clear quota of the bucket. At least one of the quota
                            clear flag is mandatory.
  set-replication-config  Set replication config on bucket
  update                  Updates the parameters of the bucket


$ ozone sh user
Missing required subcommand
Usage: ozone sh user [-hV] [COMMAND]
Tenant user management
  -h, --help      Show this help message and exit.
  -V, --version   Print version information and exit.
Commands:
  info                       Get tenant related information of a user
  assign                     Assign user accessId to tenant
  revoke                     Revoke user accessId to tenant
  assign-admin, assignadmin  Assign admin role to accessIds in a tenant
  revoke-admin, revokeadmin  Revoke admin role from accessIds in a tenant
  list, ls                   List users in a tenant
  get-secret, getsecret      Get secret given tenant user accessId. This
                               differs from `ozone s3 getsecret` that this
                               would not generate secret when the given access
                               ID doesn't exist.
  set-secret, setsecret      Set secret for a tenant user accessId.

CI:
https://github.com/adoroszlai/ozone/actions/runs/12502398129

@adoroszlai adoroszlai added tools Tools that helps with debugging code-cleanup Changes that aim to make code better, without changing functionality. labels Dec 26, 2024
@adoroszlai adoroszlai self-assigned this Dec 26, 2024
@adoroszlai
Copy link
Contributor Author

@nandakumar131 please review

Copy link
Contributor

@nandakumar131 nandakumar131 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@nandakumar131
Copy link
Contributor

Thanks @adoroszlai for the clean-up.

@nandakumar131 nandakumar131 merged commit 0d1a0ce into apache:master Jan 2, 2025
42 checks passed
@adoroszlai adoroszlai deleted the HDDS-11880 branch January 2, 2025 10:23
@adoroszlai
Copy link
Contributor Author

Thanks @nandakumar131 for reviewing and merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-cleanup Changes that aim to make code better, without changing functionality. tools Tools that helps with debugging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants