Skip to content

Commit

Permalink
Adds Operation documentation
Browse files Browse the repository at this point in the history
Adds documentation for creating users, organisations and managing
feature flags.

TODO: managing limits
  • Loading branch information
gfiorav committed Aug 17, 2015
1 parent fdc0229 commit f345bbf
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/manual/source/operations.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Operations
==========

Certain operations in the CartoDB platform can be done using rake tasks or scripts that bundle several of them together. In this section you will instructions to carry out various common operations.

Common operations in CartoDB include:

.. toctree::

operations/create_users.rst
operations/create_orgs.rst
operations/change_feature_flags.rst
operations/changing_limits.rst





158 changes: 158 additions & 0 deletions doc/manual/source/operations/change_feature_flags.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
Changing Feature Flags
======================

CartoDB uses feature flags, so different users can have access to different features of CartoDB. If you would like to enable or disable feature flags to one or all users or to a given organization, you can use the rake tasks described in this section. Feature flag creation and deletion are also covered.


Enabling a feature for all users
--------------------------------

Enabling a feature for all users is done with a rake task called ``enable_feature_for_all_users`` and it takes one parameter.

* **Feature name** is the name of the feature flag to be enabled. For example: 'special_dashboard'.

This task is executed like:

``bundle exec rake cartodb:features:enable_feature_for_all_users[<feature name>]``

And an example to enable the 'special_dashboard' feature would be:

``bundle exec rake cartodb:features:enable_feature_for_all_users["special_dashboard"]``


Enabling a feature for a given user
-----------------------------------

Enabling a feature for a given user is done with a rake task called ``enable_feature_for_user`` and it takes two parameters.

* **Feature name** is the name of the feature flag to be enabled. For example: 'special_dashboard'.
* **User's user name** is the user name of the user to whom the feature flag is to be enabled. For example: 'manolo'.

This task is executed like:

``bundle exec rake cartodb:features:enable_feature_for_user[<feature name>,<user name>]``

**NOTE** Please be very careful **NOT** to leave a space between parameters, as it will cause rake to spit ``don't know how to build task`` error.

And an example to enable the 'special_dashboard' feature for user with user name 'manolo' would be:

``bundle exec rake cartodb:features:enable_feature_for_user["special_dashboard","manolo"]``

This comment has been minimized.

Copy link
@javisantana

This comment has been minimized.

Copy link
@gfiorav

gfiorav Aug 17, 2015

Author Contributor

Done

This comment has been minimized.

Copy link
@javisantana

javisantana Aug 17, 2015

Contributor

:ES:



Enabling a feature for a given organization
-------------------------------------------

Enabling a feature for a given organization is done with a rake task called `'enable_feature_for_organization`` and it takes two parameters.

* **Feature name** is the name of the feature flag to be enabled. For example: 'special_dashboard'.
* **Organization name** is the internal name ('cartodb' vs 'CartoDB Inc.') to which the feature flag is to be enabled. For example: 'cartodb'.

This task is executed like:

``bundle exec rake cartodb:features:enable_feature_for_organization[<feature name>,<organization name>]``

**NOTE** Please be very careful **NOT** to leave a space between parameters, as it will cause rake to spit ``don't know how to build task`` error.

And an example to enable the 'special_dashboard' feature for organization 'cartodb' would be:

``bundle exec rake cartodb:features:enable_feature_for_organization["special_dashboard","cartodb"]``


Disabling a feature for all users
---------------------------------

Disabling a feature for all users is done with a rake task called ``disable_feature_for_all_users`` and it takes one parameter.

* **Feature name** is the name of the feature flag to be disabled. For example: 'special_dashboard'.

This task is executed like:

``bundle exec rake cartodb:features:disable_feature_for_all_users[<feature name>]``

And an example to disable the 'special_dashboard' feature would be:

``bundle exec rake cartodb:features:disable_feature_for_all_users["special_dashboard"]``


Disabling a feature for a given user
------------------------------------

Disabling a feature for a given user is done with a rake task called ``disable_feature_for_user`` and it takes two parameters.

* **Feature name** is the name of the feature flag to be disabled. For example: 'special_dashboard'.
* **User's user name** is the user name of the user to whom the feature flag is to be disabled. For example: 'manolo'.

This task is executed like:

``bundle exec rake cartodb:features:disable_feature_for_user[<feature name>,<user name>]``

**NOTE** Please be very careful **NOT** to leave a space between parameters, as it will cause rake to spit ``don't know how to build task`` error.

And an example to disable the 'special_dashboard' feature for user with user name 'manolo' would be:

``bundle exec rake cartodb:features:disable_feature_for_user["special_dashboard","manolo"]``


Disabling a feature for a given organization
--------------------------------------------

Disabling a feature for a given organization is done with a rake task called `'disable_feature_for_organization`` and it takes two parameters.

* **Feature name** is the name of the feature flag to be disabled. For example: 'special_dashboard'.
* **Organization name** is the internal name ('cartodb' vs 'CartoDB Inc.') to which the feature flag is to be disabled. For example: 'cartodb'.

This task is executed like:

``bundle exec rake cartodb:features:disable_feature_for_organization[<feature name>,<organization name>]``

**NOTE** Please be very careful **NOT** to leave a space between parameters, as it will cause rake to spit ``don't know how to build task`` error.

And an example to disable the 'special_dashboard' feature for organization 'cartodb' would be:

``bundle exec rake cartodb:features:disable_feature_for_organization["special_dashboard","cartodb"]``


Adding a feature flag
---------------------

Adding feature flags should be done using the rake task called ``add_feature flag``. This rake task only takes one argument:

* **Feature name** is the name of the feature flag to be created.

This task is executed like:

``bundle exec rake cartodb:features:add_feature flag[<feature name>]``

And an example to create a feature flag named "special_dashboard" would be:

``bundle exec rake cartodb:features:add_feature flag["special_dashboard"]``


Removing a feature flag
-----------------------

Removing feature flags should be done using the rake task called ``remove_feature flag``. This rake task only takes one argument:

* **Feature name** is the name of the feature flag to be removed.

This task is executed like:

``bundle exec rake cartodb:features:remove_feature flag[<feature name>]``

And an example to remove a feature flag named "special_dashboard" would be:

``bundle exec rake cartodb:features:remove_feature flag["special_dashboard"]``


Listing all feature flags
-------------------------

All existing feature flags can be listed using the rake task called ``list_all_features``.

This task is executed like:

``bundle exec rake cartodb:features:list_all_features``




16 changes: 16 additions & 0 deletions doc/manual/source/operations/create_orgs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Creating organizations
======================

To create a new organization, a rake task called ``create_new_organization_with_owner`` is used. For this task to work properly, a user **created beforehand** must be provided as an owner (if you're not sure how to create a user, refer to "Creating Users").

In order to create the organization, 4 parameters must be set:

* **Organization name** is a short nickname for the organization, that may only contain letters, numbers and dash (-) characters. For example, 'cartodb' would be OK.
* **Organization display name** is a longer, more beautiful name for the organization. It may contain any characters needed. For example, 'CartoDB Inc.'.
* **Organization seats** is the number of users that will be able to be created under the organization. For example, 5 seats will mean that a maximum of 5 users can belong to the organization.
* **Organization quota** is the space quota in **bytes** that the organization is assigned. For example, 1024 * 1024 * 1024 is 1GB of quota.
* **Owner's user name** is the user name of the owner of the organization. In our example, let's assume that our user name is 'manolo'.

Taking into account the previous information, creating an organization owned by 'manolo', named 'CartoDB Inc.', referred to as 'cartodb', with 5 seats and a 1GB quota, is just running the following command:

``bundle exec rake cartodb:db:create_new_organization_with_owner ORGANIZATION_NAME="cartodb" ORGANIZATION_DISPLAY_NAME="CartoDB Inc." ORGANIZATION_SEATS="5" ORGANIZATION_QUOTA="1073741824" USERNAME="manolo"``
14 changes: 14 additions & 0 deletions doc/manual/source/operations/create_users.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Creating users
==============

Creating users in CartoDB is simple thanks to the ``create_dev_user`` script located in ``scripts/create_dev_user``. To execute this script, be sure to be located at the cartodb repository root directory and simply run:

``./script/create_dev_user``

You will be prompted to input 3 parameters:

* **subdomain** is the same as "username". This is what you will enter in the browser to access the user's dashboard: ``https://username.cartodb.com``. Set it to whatever you want the user's user name to be.
* **password** this is the password the new user will use to login into their account.
* **admin password** this password will be an admin password for the newly created users.

Upon script completion, the new user will have been created.

0 comments on commit f345bbf

Please sign in to comment.