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

Implement server API #159

Closed
65 tasks
mijicd opened this issue Nov 20, 2020 · 5 comments
Closed
65 tasks

Implement server API #159

mijicd opened this issue Nov 20, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request zio-hackathon ZIO Hackathon 2020

Comments

@mijicd
Copy link
Member

mijicd commented Nov 20, 2020

Extracted from this comment authored by @regis-leray.

Commands

  • ACL LOAD Reload the ACLs from the configured ACL file
  • ACL SAVE Save the current ACL rules in the configured ACL file
  • ACL LIST List the current ACL rules in ACL config file format
  • ACL USERS List the username of all the configured ACL rules
  • ACL GETUSER username Get the rules for a specific ACL user
  • ACL SETUSER username [rule [rule ...]] Modify or create the rules for a specific ACL user
  • ACL DELUSER username [username ...] Remove the specified ACL users and the associated rules
  • ACL CAT [categoryname] List the ACL categories or the commands inside a category
  • ACL GENPASS [bits] Generate a pseudorandom secure password to use for ACL users
  • ACL WHOAMI Return the name of the user associated to the current connection
  • ACL LOG [count or RESET] List latest events denied because of ACLs in place
  • ACL HELP Show helpful text about the different subcommands
  • BGREWRITEAOF Asynchronously rewrite the append-only file
  • BGSAVE [SCHEDULE] Asynchronously save the dataset to disk
  • COMMAND Get array of Redis command details
  • COMMAND COUNT Get total number of Redis commands
  • COMMAND GETKEYS Extract keys given a full Redis command
  • COMMAND INFO command-name [command-name ...] Get array of specific Redis command details
  • CONFIG GET parameter Get the value of a configuration parameter
  • CONFIG REWRITE Rewrite the configuration file with the in memory configuration
  • CONFIG SET parameter value Set a configuration parameter to the given value
  • CONFIG RESETSTAT Reset the stats returned by INFO
  • DBSIZE Return the number of keys in the selected database
  • DEBUG OBJECT key Get debugging information about a key
  • DEBUG SEGFAULT Make the server crash
  • FLUSHALL [ASYNC] Remove all keys from all databases
  • FLUSHDB [ASYNC] Remove all keys from the current database
  • INFO [section] Get information and statistics about the server
  • LOLWUT [VERSION version] Display some computer art and the Redis version
  • LASTSAVE Get the UNIX time stamp of the last successful save to disk
  • MEMORY DOCTOR Outputs memory problems report
  • MEMORY HELP Show helpful text about the different subcommands
  • MEMORY MALLOC-STATS Show allocator internal stats
  • MEMORY PURGE Ask the allocator to release memory
  • MEMORY STATS Show memory usage details
  • MEMORY USAGE key [SAMPLES count] Estimate the memory usage of a key
  • MODULE LIST List all modules loaded by the server
  • MODULE LOAD path [ arg [arg ...]] Load a module
  • MODULE UNLOAD name Unload a module
  • MONITOR Listen for all requests received by the server in real time
  • ROLE Return the role of the instance in the context of replication
  • SHUTDOWN [NOSAVE|SAVE] Synchronously save the dataset to disk and then shut down the server
  • SLAVEOF host port Make the server a replica of another instance, or promote it as master. Deprecated starting with Redis 5. Use REPLICAOF instead.
  • REPLICAOF host port Make the server a replica of another instance, or promote it as master.
  • SLOWLOG subcommand [argument] Manages the Redis slow queries log
  • SWAPDB index1 index2 Swaps two Redis databases
  • SYNC Internal command used for replication
  • PSYNC replicationid offset Internal command used for replication
  • TIME Return the current server time- [ ] ROLE Return the role of the instance in the context of replication
  • SHUTDOWN [NOSAVE|SAVE] Synchronously save the dataset to disk and then shut down the server
  • SLAVEOF host port Make the server a replica of another instance, or promote it as master. Deprecated starting with Redis 5. Use REPLICAOF instead.
  • REPLICAOF host port Make the server a replica of another instance, or promote it as master.
  • SLOWLOG subcommand [argument] Manages the Redis slow queries log
  • SWAPDB index1 index2 Swaps two Redis databases
  • SYNC Internal command used for replication
  • PSYNC replicationid offset Internal command used for replication
  • TIME Return the current server time
  • LATENCY DOCTOR Return a human readable latency analysis report.
  • LATENCY GRAPH event Return a latency graph for the event.
  • LATENCY HISTORY event Return timestamp-latency samples for the event.
  • LATENCY LATEST Return the latest latency samples for all events.
  • LATENCY RESET [event [event ...]] Reset latency data for one or more events.
  • LATENCY HELP Show helpful text about the different subcommands.
  • OBJECT subcommand [arguments [arguments ...]] Inspect the internals of Redis objects
  • SAVE Synchronously save the dataset to disk

Tips

  • Define the API in zio.redis.api.
  • Command-specific options should be defined in zio.redis.options.
  • Additional inputs and outputs can be defined in zio.redis.Input and zio.redis.Output, respectively.
  • Redis API evolves, therefore the commands listed above might be slightly changed. Double check the official docs before starting with implementation.
  • Use telnet to understand command protocol details.
  • Write inputs and outputs tests in zio.redis.InputSpec and zio.redis.OutputSpec, respectively.
  • Write integration tests by expanding the zio.redis.ApiSpec.
  • If you feel that the pull request size is growing out of control, feel free to split it but make sure to link this issue in each of the related PRs.
@mijicd mijicd added enhancement New feature or request zio-hackathon ZIO Hackathon 2020 labels Nov 20, 2020
@hcwilhelm
Copy link
Contributor

I would like to take this one.

I started to implement a couple of commands from the Server API and quickly run into some quite complex ones like ACL SETUSER. It would be nice if I could chat with somebody about how to model the input's and output of such commands in a proper ADT, or if that is a bit too much how we can represent this in a more general data structure.

Here is the branch I am working on https://github.com/hcwilhelm/zio-redis/tree/server_api

@mijicd
Copy link
Member Author

mijicd commented Jan 5, 2022

All yours. Regarding the chat, let's catch up sometimes next week.

@hcwilhelm
Copy link
Contributor

@mijicd I am slowly making progress on this one. Would you mind taking a look at my branch or would you prefer a draft PR ?

Branch is here: https://github.com/hcwilhelm/zio-redis/tree/server_api

@mijicd
Copy link
Member Author

mijicd commented Jan 29, 2022

@hcwilhelm draft PR would be great 🙏

@hcwilhelm
Copy link
Contributor

@mijicd ok, here it is. As mentioned in the PR description please ignore the changes in the ApiSpec object, I mainly removed everything except the test where I am working on.

Draft PR: #529

@mijicd mijicd added this to the 0.5.0 milestone Apr 6, 2023
@mijicd mijicd removed this from the 0.5.0 milestone Sep 26, 2024
@mijicd mijicd closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request zio-hackathon ZIO Hackathon 2020
Projects
None yet
Development

No branches or pull requests

2 participants