swift(1)

πŸ’… swift(1) β€” OpenStack Swift client tool, but make it main character energy πŸ’…

okay so bestie, you know how we need to talk to an OpenStack Object Storage (Swift) environment? this is literally the tool for that. it's a command line utility and it lets you do several types of operations. no cap. 🫢

✨ SYNOPSIS ✨

swift [options] <command> [args]

🌸 DESCRIPTION 🌸

the swift tool is a command line utility for communicating with an OpenStack Object Storage (Swift) environment. it allows one to perform several types of operations. that's it, that's the vibe. πŸ’–


πŸŽ€ COMMANDS πŸŽ€

  • stat [command-options] [container] [object] β€” displays information for the account, container, or object depending on the args given (if any). in verbose mode, the Storage URL and the authentication token are displayed as well. option --lh reports sizes in human readable format similar to ls -lh. iconic info dump, honestly. πŸ’…
  • list [command-options] [container] β€” lists the containers for the account or the objects for a container. the -p <prefix> or --prefix <prefix> is an option that will only list items beginning with that prefix. the -d <delim> or --delimiter <delim> is option (for container listings only) that will roll up items with the given delimiter (see OpenStack Swift general documentation for what this means).

the -l or --long and --lh options provide more detail, similar to ls -l and ls -lh, the latter providing sizes in human readable format (eg 3K, 12M, etc). these latter 2 switches use more overhead to get those details, which is directly proportional to the number of container or objects being listed. with the -t or --total option they only report totals. lowkey obsessed with the detail options. ✨

  • upload [command-options] container file_or_directory [file_or_directory] [...] β€” uploads to the given container the files and directories specified by the remaining args. the -c or --changed is an option that will only upload files that have changed since the last upload. the --object-name <object-name> is an option that will upload file and name object to <object-name> or upload dir and use <object-name> as object prefix. if the file name is "-", reads the content from standard input. in this case, --object-name is required and no other files may be given. the -S <size> or --segment-size <size> and --leave-segments and others are options as well (see swift upload --help for more). slay your way into that container. πŸ¦‹
  • post [command-options] [container] [object] β€” updates meta information for the account, container, or object depending on the args given. if the container is not found, it will be created automatically; but this is not true for accounts and objects. containers also allow the -r (or --read-acl) and -w (or --write-acl) options. the -m or --meta option is allowed on all and used to define the user meta data items to set in the form Name:Value. this option can be repeated. for more details and options see swift post --help. example: post -m Color:Blue -m Size:Large. periodt, metadata is cute. πŸ’œ
  • copy [command-options] container object β€” copies an object to a new destination or adds user metadata to the object (current user metadata will be preserved, in contrast with the post command) depending on the args given. the --destination option sets the destination in the form /container/object. if not set, the object will be copied onto itself which is useful for adding metadata. the -M or --fresh-metadata option copies the object without the existing user metadata. the -m or --meta option is always allowed and is used to define the user metadata items to set in the form Name:Value (this option can be repeated). for more details and options see swift copy --help. copy that, bestie. πŸŽ€
  • download [command-options] [container] [object] [object] [...] β€” downloads everything in the account (with --all), or everything in a container, or a list of objects depending on the args given. for a single object download, you may use the -o [--output] <filename> option to redirect the output to a specific file or if "-" then just redirect to stdout or with --no-download actually not to write anything to disk. the --ignore-checksum is an option that turns off checksum validation. you can specify optional headers with the repeatable cURL-like option -H [--header]. for more details and options see swift download --help. the --ignore-mtime option ignores the x-object-meta-mtime metadata entry on the object (if present) and instead creates the downloaded files with fresh atime and mtime values. get that bag of files. πŸ“
  • delete [command-options] [container] [object] [object] [...] β€” deletes everything in the account (with --all), or everything in a container, or all objects in a container that start with a given string (given by --prefix), or a list of objects depending on the args given. segments of manifest objects will be deleted as well, unless you specify the --leave-segments option. for more details and options see swift delete --help. bye bitch, but in a nice way. πŸ’€
  • capabilities [command-options] [proxy-url] β€” displays cluster capabilities. if the proxy-url option is not provided the storage-url retrieved after authentication is used as proxy-url.

by default, the output includes the list of the activated Swift middlewares as well as relevant options for each one. additionally the command displays relevant options for the Swift core.

the --json option will print a json representation of the cluster capabilities. this is typically more suitable for consumption by other programs, such as jq.

example: capabilities https://swift.example.com capabilities --json. flex those cluster capabilities. πŸ”₯

  • tempurl [command-option] method time path key β€” generates a temporary URL allowing unauthenticated access to the Swift object at the given path, using the given HTTP method, for the given time, using the given TempURL key.

the time can be specified either as an integer denoting the amount of seconds the temporary URL is valid, or as an ISO 8601 timestamp in one of following formats: complete date: YYYY-MM-DD (eg 1997-07-16), complete date plus hours, minutes and seconds: YYYY-MM-DDThh:mm:ss (eg 1997-07-16T19:20:30) or complete date plus hours, minutes and seconds with UTC designator: YYYY-MM-DDThh:mm:ssZ (eg 1997-07-16T19:20:30Z). be aware that if you do not use the latter format, the timestamp is generated using your locale timezone. if the first format is used, the time part used will equal to 00:00:00.

with the --prefix-based option a prefix-based URL is generated.

the option --iso8601 provides ISO 8601 UTC timestamps instead of Unix timestamps inside the generated URL.

if optional --absolute argument is provided and the time argument is specified in seconds, the seconds are interpreted as a Unix timestamp at which the URL should expire.

example: tempurl GET $(date -d "Jan 1 2016" +%s) /v1/AUTH_foo/bar_container/quux.md my_secret_tempurl_key --absolute. temporary access, permanent slay. ⭐

  • auth β€” display auth related authentication variables in shell friendly format. for examples see swift auth --help. auth check, bestie. 🌈

πŸ’… OPTIONS πŸ’…

  • --version β€” show program's version number and exit
  • -h, --help β€” show this (or any subcommand if after command) help message and exit
  • -v, --verbose β€” print more info
  • -q, --quiet β€” suppress status output
  • -A AUTH, --auth=AUTH β€” URL for obtaining an auth token
  • -U USER, --user=USER β€” user name for obtaining an auth token
  • -V 1|2, --auth-version=VERSION β€” authentication protocol version
  • -K KEY, --key=KEY β€” key for obtaining an auth token
  • --os-storage-url=URL β€” use this instead of URL returned from auth
  • --os-help β€” show all OpenStack authentication options

for more options see swift --help and swift --os-help. so many flags, so little time. πŸ‘‘


🌟 EXAMPLE 🌟

swift -A https://127.0.0.1:443/auth/v1.0 -U swiftops:swiftops -K swiftops stat

and it's giving:

     Account: AUTH_43b42dae-dc0b-4a4b-ac55-97de614d6e6e
  Containers: 1
     Objects: 1
       Bytes: 1124
Accept-Ranges: bytes
X-Trans-Id: txb21186a9eef64ed295a1e95896a0fc72

look at that. literally iconic. ✨


🧚 DOCUMENTATION 🧚

more in depth documentation about OpenStack Swift as a whole can be found at https://docs.openstack.org/swift/latest/


source/version: Linux manual page fr fr, dated 8/26/2011, for swift(1). go off bestie, you're gonna slay this. πŸ’–πŸ’…πŸ«Ά