A CloudFoundry Plugin for interacting with OpenStack Object Storage
Table of Contents
Static Large Objects (SLOs) and Dynamic Large Objects (DLOs) are incredibly useful aggregate file types available in OpenStack Object Storage. However, manipulating them can be quite difficult. This Cloud Foundry CLI plugin is designed to make using SLOs and DLOs much more accessible.
This plugin makes heavy use of the swiftlygo library. Much more information on SLOs and DLOs can be found by reading that library's README.
Additionally, some basic object and container interactions are included as commands. This allows for working with Object Storage from the command line without having to go through the long authentication process on your own.
Dependenies: This plugin requires the Cloud Foundry CLI version 6.21.0 or later. You can check your version with
cf version. Install and update instructions can be found here.
Since this plugin is not currently in an offical Cloud Foundry plugin repo, it will need to be downloaded and installed manually.
Install From Binary (Recommended)
Download the binary for your machine from the releases page
and navigate to the downloaded binary from within your terminal. Then run the following
cf command from the directory
the binary was downloaded to.
Note: If you are reinstalling, run
cf uninstall-plugin cf-object-storage first to uninstall the outdated
Mac & Linux
cf install-plugin cf-object-storage
If you get a permission error, ensure that the binary has execute permissions.
chmod +x cf-object-storage
cf install-plugin cf-object-storage.exe
Install From Source
Installing this way requires Go. Binaries and install instructions can be found on their official website. To download this package, open your terminal and run
go get github.com/ibmjstart/cf-object-storage
Mac & Linux
Navigate to the project's root directory, which should be
most standard Go setups. The provided
reinstall.sh script can then be ran to install the plugin.
cd $GOPATH/src/github.com/ibmjstart/cf-object-storage ./scripts/reinstall.sh
reinstall.sh first attempts to uninstall the plugin, so you will get a failure message from the uninstall
command if the plugin is not already installed. However, as long as the following install succeeds all should work fine.
reinstall.sh is intended for use on Mac and Linux. To install on Windows, first navigate to the project's root
directory, which should be
%GOPATH%\src\github.com\ibmjstart\cf-object-storage with most standard Go setups. Then
build and install as shown.
cd %GOPATH%\src\github.com\ibmjstart\cf-object-storage go build cf install-plugin cf-object-storage.exe
This plugin is invoked as follows:
cf os SUBCOMMAND [ARGS...]
Sixteen subcommands are included in this plugin, described below. More information can be found by using
cf os help
followed by any of the subcommands.
||Retrieve and store! a service's x-auth info|
||Show all containers in an Object Storage instance|
||Show a given container's information|
||Create a new container in an Object Storage instance|
||Update an existing container's metadata|
||Rename an existing container!!|
||Remove a container from an Object Storage instance|
||Show all objects in a container|
||Show a given object's information|
||Upload a file to Object Storage|
||Download an object from Object Storage|
||Rename an object|
||Copy an object from one container to another|
||Remove an object from a container|
||Create a DLO manifest in Object Storage|
||Upload a file to Object Storage as an SLO|
auth checks if
HOME/.cf/os_creds.json exists and contains the target service's x-auth token and
storage url. If it does, these credentials are used to authenticate with Object Storage (which saves a few http requests).
Upon successful authentication,
auth will save a service's x-auth info to the above location to speed up subsequent
rename-container should not be used (and will likely fail) on containers containing SLOs and DLOs. This is due to their strict naming conventions that expect certain containers to have certain names.
Small note: If editing the README, please conform to the standard-readme specification.
Apache 2.0 © IBM jStart