Skip to content

Commit

Permalink
cli docs (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Schrock authored and Derek Smart committed Oct 3, 2019
1 parent 9b8fea9 commit bb1e916
Show file tree
Hide file tree
Showing 16 changed files with 434 additions and 16 deletions.
26 changes: 25 additions & 1 deletion docs/src/cli/cmd/abort.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,28 @@
titan abort
===========

Coming soon!
Aborts any in-progress push or pull operation for a repository. Most push and
pull operations finish in the context of when they were invoked, but in rare
cases (such as the CLI exiting unexpectedly), they can continue to run in the
background. This command provides a way to abort such operations.

Syntax
------

::

titan abort <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

Example
-------

::

$ titan abort hello-world
aborting operation 13ac9b7a-15f2-41ea-9b61-bc271234d123
47 changes: 46 additions & 1 deletion docs/src/cli/cmd/cp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,49 @@
titan cp
========

Coming soon!
Copies data from an existing directory on the host into a titan repository.
Each container has data at a known place, such as ``/var/lib/data/postgresql``
for PostgreSQL. This command allows users to copy data created by another
instance of the database into the titan repository.

If there is only one volume then the destination is not required. If there
is more than one volume, then you must specify the destination within the
repository container. For more information on copying data into repositories,
including how to determine what destinations are available, see the
:ref:`local_copy` section.

Syntax
------

::

titan cp <-s source> [-d destination] <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

Options
-------

-s, --source dir *Required*. Source directory on the host system. This
must match the layout and contents expected by the
container.

-d, --destination dir Required if there is more than volume associated with
the repository. Specifies the path where data should
be copied to within the repository. Must correspond
to a volume path in the repository container.

Example
-------

::

$ titan cp -s /var/postgres-data/ hello-world
hello-world stopped
Copying data to hello-world/v0
hello-world started
hello-world running with data from /var/postgres-data
42 changes: 41 additions & 1 deletion docs/src/cli/cmd/migrate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,44 @@
titan migrate
=============

Coming soon!
Migrate data from a running container into new Titan repository. Given a
stopped container with volumes mounted from the host system, this command
will create a new container with an identical configuration, and then
copy over the data into the new repository. For more information, see the
:ref:`local_migrate` section.

.. note::

The migrate command will only work if the volumes have been mounted from
host system. Migrating local to the container, or from a different volume
driver, is not supported.

Syntax
------

::

titan migrate <-s source> <repository>

Arguments
---------

repository
*Required*. The name of the repository to create.

Options
-------

-s, --source container Name of source container.

Example
-------

::

$ titan migrate -s postgres_source hello-world
Creating repository hello-world
Creating docker volume hello-world/v0 with path /var/lib/postgresql/data
Copying data to hello-world/v0
Commit 9560ffb0-6bbc-4b1c-acb5-1142f86c0354
postgres_source migrated to controlled environment hello-world
35 changes: 34 additions & 1 deletion docs/src/cli/cmd/pull.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,37 @@
titan pull
==========

Coming soon!
Pull a commit from a remote repository. For more information on pushing
commits, see the :ref:`remote_pushpull` section.

Syntax
------

::

titan pull [-c commit] [-r remote] <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

Options
-------

-c, --commit commit Commit to pull. If not specified, then the latest
commit is used.

-r, --remote remote Name of remote to push to. If not specified, defaults
to "origin".

Example
-------

::

$ titan pull hello-world
PULL 0f53a6a4-90ff-4f8c-843a-a6cce36f4f4f from origin RUNNING
Pulling 0f53a6a4-90ff-4f8c-843a-a6cce36f4f4f from 'origin'
PULL 0f53a6a4-90ff-4f8c-843a-a6cce36f4f4f from origin COMPLETE
36 changes: 35 additions & 1 deletion docs/src/cli/cmd/push.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,38 @@
titan push
==========

Coming soon!
Push a commit to a remote repository. For more information on pushing
commits, see the :ref:`remote_pushpull` section.

Syntax
------

::

titan push [-c commit] [-r remote] <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

Options
-------

-c, --commit commit Commit to push. If not specified, then the latest
commit is used.

-r, --remote remote Name of remote to push to. If not specified, defaults
to "origin".

Example
-------

::

$ titan push hello-world
PUSH 0f53a6a4-90ff-4f8c-843a-a6cce36f4f4f to ssh RUNNING
Pushing 0f53a6a4-90ff-4f8c-843a-a6cce36f4f4f to 'origin'
Syncing /var/lib/postgresql/data
21.10MB (17.07MB/s)PUSH 0f53a6a4-90ff-4f8c-843a-a6cce36f4f4f to ssh COMPLETE
33 changes: 32 additions & 1 deletion docs/src/cli/cmd/remote_add.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,35 @@
titan remote add
================

Coming soon!
Add a new remote. For more information on managing remotes, see
the :ref:`remote_addremove` section.

Syntax
------

::

titan remote add [-r remote] <uri> <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

uri
*Required*. The remote URI to use. For more information on URI format,
see the provider sections under the :ref:`remote` section.

Options
-------

-r, --remote remote Optional remote name. If not provided, then the name
'origin' is assumed.

Example
-------

::

$ titan remote add -r upstream s3://titan-data-demo/hello-world/postgres hello-world
36 changes: 35 additions & 1 deletion docs/src/cli/cmd/remote_log.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,38 @@
titan remote log
================

Coming soon!
List commits in a remote. For more information on managing remotes, see
the :ref:`remote` section.

Syntax
------

::

titan remote log [-r remote] <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

Options
-------

-r, --remote remote Optional remote name. If not provided, then the name
'origin' is assumed.

Example
-------

::

$ titan remote log hello-world
Remote: origin
Commit 0f53a6a4-90ff-4f8c-843a-a6cce36f4f4f
User: Eric Schrock
Email: [email protected]
Date: 2019-09-20T13:45:38Z

demo data
25 changes: 24 additions & 1 deletion docs/src/cli/cmd/remote_ls.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,27 @@
titan remote ls
===============

Coming soon!
List remotes for the given repository. For more information on managing remotes,
see the :ref:`remote_addremove` section.

Syntax
------

::

titan remote ls <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

Example
-------

::

$ titan remote ls hello-world
REMOTE PROVIDER
origin s3
27 changes: 26 additions & 1 deletion docs/src/cli/cmd/remote_rm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,29 @@
titan remote rm
===============

Coming soon!
Remove a remote from a repository. For more information on managing remotes,
see the :ref:`remote_addremove` section.

Syntax
------

::

titan remote rm <repository> <remote>

Arguments
---------

repository
*Required*. The name of the target repository.

remote
*Required*. The name of the remote to remove.

Example
-------

::

$ titan remote rm hello-world origin
Removed origin from hello-world
26 changes: 25 additions & 1 deletion docs/src/cli/cmd/rm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,28 @@
titan rm
========

Coming soon!
Removes a repository. This will stop the container and destroy any local data.
This operation cannot be undone.

Syntax
------

::

titan rm [-f] <repository>

Arguments
---------

repository
*Required*. The name of the target repository.

Example
-------

::

$ titan rm -f hello-world
Removing container hello-world
Deleting volume hello-world/v0
hello-world removed
Loading

0 comments on commit bb1e916

Please sign in to comment.