{ "info": { "author": "Greg Moselle", "author_email": "greg.moselle@enstratius.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "es-riak\n=======\n\nThis is a helper script for interacting with Riak.\n\nBefore you begin using this utility, you should know that it was written to\ninteract not just with Riak, but with a specific instantiaion of Riak used to\nsupport the Enstratius cloud management software suite. \n\nThere are methods available here, such as ``--elevate-api-key`` that have no\nmeaning outside of the context of an installation of Riak to support the\nEnstratius cloud management software suite.\n\nWhile this script was written to interact with Riak supporting Enstratius, the\nscript itself is in no way endorsed or supported by Enstratius or Dell\nSoftware. \n\nWord of warning\n---------------\n\nBy using this script you are violating the datamunging warning set by John Vincent in his\nRiak overview. Proceed at your own risk.\n\nRequirements\n------------\n\n1. Python\n2. [Requests Library](http://docs.python-requests.org/en/latest/user/install/#install)\n\nHelpful: http://docs.python-requests.org/en/latest/user/quickstart\n\nInstallation\n------------\n\n.. code-block:: bash\n\n sudo easy_install riak-cli-tool\n\nor\n\n.. code-block:: bash\n\n sudo pip install riak-cli-tool\n\n\nSecondary Indices\n-----------------\n\nEnstratius makes heavy use of secondary indices. This scrip is supposed to\nfind, save, and utilize existing secondary indices when updating bucket\ncontents that have them in place.\n\nThis is not well tested.\n\nConfiguration Files\n-------------------\n\nNone. You'll want to add an export statement to your profile:\n\n\n.. code-block:: bash\n\n export riak_host='127.0.0.1'\n\nand make sure it is sourced before attempting to use the utility.\n\nThe port is set to 8098.\n\nCommands\n--------\n\nList all buckets \n~~~~~~~~~~~~~~~~\n\nTHIS IS A BAD IDEA, USUALLY. \n\n.. code-block:: bash\n\n es-riak --list-buckets\n \n {\n \"buckets\": [\n \"content_template\", \n \"configuration_management_system\", \n \"frontend_configuration\"\n ]\n }\n\nList all keys in a bucket\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTHIS IS A BAD IDEA, USUALLY. \n\n.. code-block:: bash\n\n es-riak --list-keys -b content_template\n \n {\n \"keys\": [\n \"passwordChangeSubject\", \n \"optimusEngineEmail\", \n \"changeAccountData_en\"\n ]\n }\n\nShow the contents of a bucket\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: bash\n\n es-riak --show -b frontend_configuration -k 1\n \n {\n \"SCHEMA_VERSION\": \"0\", \n \"autoProvisionUsers\": \"true\", \n \"defaultAuthenticationMethod\": \"NATIVE\", \n \"defaultGroupIds\": [], \n \"forceDefaultAuthentication\": \"true\", \n \"forceDeny\": [], \n \"masterNetworkId\": 999, \n \"systemName\": \"Enstratius\"\n }\n\nSave the contents of a bucket/key to a file:\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: bash\n\n es-riak --save save_file.json -b frontend_configuration -k 1\n \n Saved contents of: \n \n http://172.16.243.131:8098/buckets/frontend_configuration/keys/1 \n \n to \n \n save_file.json\n \nChecking the contents of the save file:\n\n.. code-block:: bash\n\n cat save_file.json | python -mjson.tool\n \n {\n \"SCHEMA_VERSION\": \"0\", \n \"autoProvisionUsers\": \"true\", \n \"defaultAuthenticationMethod\": \"NATIVE\", \n \"defaultGroupIds\": [], \n \"forceDefaultAuthentication\": \"true\", \n \"forceDeny\": [], \n \"masterNetworkId\": 1, \n \"systemName\": \"Enstratius\"\n }\n\nUpdate the contents of a bucket/key by passing in a json file\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: bash\n\n es-riak --update -b frontend_configuration -k 1 -i input.json\n Valid JSON\n updating!\n \n Saved contents of: \n \n http://172.16.243.131:8098/buckets/frontend_configuration/keys/1 \n \n to \n \n input.json.original\n \n \n Done.\n \n To view your changes, call:\n \n es-riak --show -b frontend_configuration -k 1\n\nwhere the file ``input.json`` has contents:\n\n.. code-block:: bash\n\n cat input.json | python -mjson.tool\n \n {\n \"SCHEMA_VERSION\": \"0\", \n \"autoProvisionUsers\": \"true\", \n \"defaultAuthenticationMethod\": \"NATIVE\", \n \"defaultGroupIds\": [], \n \"forceDefaultAuthentication\": \"true\", \n \"forceDeny\": [], \n \"masterNetworkId\": 999, \n \"systemName\": \"Enstratius\"\n }\n\nbucket contents post-update:\n\n.. code-block:: bash\n\n es-riak --show -b frontend_configuration -k 1\n \n {\n \"SCHEMA_VERSION\": \"0\", \n \"autoProvisionUsers\": \"true\", \n \"defaultAuthenticationMethod\": \"NATIVE\", \n \"defaultGroupIds\": [], \n \"forceDefaultAuthentication\": \"true\", \n \"forceDeny\": [], \n \"masterNetworkId\": 999, \n \"systemName\": \"Enstratius\"\n }\n\nDoing a \"PUT\" to a bucket/key\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA plain old \"PUT\" differs from an update in that there is no step of saving the\ncurrent contents of a bucket/key (as there may be none) prior to putting the\ncontents of the passed file to the bucket/key.\n\nFuthermore, if there happen to be existing contents of a given bucket/key such\nas -b frontend_configuration -k 1 and a put is made to that combination, the\nexisting contents will be immediately overwritten. \n\nTo put the contents of a file to a bucket/key, execute a call like this:\n\n.. code-block:: bash\n\n es-riak --put -b frontend_configuration -k 1 -i input.json\n\nwhere the contents of input.json might be:\n\n.. code-block:: json\n\n {\n \"SCHEMA_VERSION\": \"0\",\n \"autoProvisionUsers\": \"true\",\n \"defaultAuthenticationMethod\": \"NATIVE\",\n \"forceDefaultAuthentication\": \"true\",\n \"masterNetworkId\": 1,\n \"systemName\": \"Enstratius Hosted\",\n \"systemReplyEmail\": \"systemreplyemail@enstratius.com\",\n \"systemSupportEmail\": \"systemsupportemail@enstratius.com\",\n \"systemSupportUrl\": \"http://system.support.url.com\",\n \"systemUserConsoleUrl\": \"https://system.user.console.url/test\"\n }\n\nThe ``--put`` flag will trigger the following checks before attempting to put\nthe file contents to the bucket/key:\n\n#. Does the file exist?\n#. Is the file valid JSON?\n\n.. code-block:: bash\n\n So be it.\n \n Valid JSON\n \n Putting the contents of\n \n input.json\n \n to\n \n http://127.0.0.1:8098/buckets/frontend_configuration/keys/1\n \n \n Done.\n \n To view the results of this action, call:\n \n es-riak --show -b frontend_configuration -k 1\n\n\nValidating an input JSON file\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nValid JSON:\n^^^^^^^^^^^\n\n.. code-block:: bash\n\n es-riak --validate -i input.json\n \n Valid JSON\n\nInvalid JSON:\n^^^^^^^^^^^^^\n\n.. code-block:: bash\n\n es-riak --validate -i invalid.txt \n \n Invalid JSON\n\nWhere the contents of invalid.txt are:\n\n.. code-block:: bash\n\n {\n \"SCHEMA_VERSION\": \"0\", \n \"autoProvisionUsers\": \"true\", \n \"defaultAuthenticationMethod\": \"NATIVE\", \n \"defaultGroupIds\": [], \n \"forceDefaultAuthentication\": \"true\", \n \"forceDeny\": [], \n \"masterNetworkId\": 999, \n \"systemName\": \n }\n\n\nElevating an API key\n~~~~~~~~~~~~~~~~~~~~\n\nYou can use this utility to elevate an API key to a \"system\" key.\n\n.. code-block:: bash\n\n es-riak --elevate-api-key -b api_key -k \n\nAn example of this type of interaction is shown here:\n\n.. code-block:: bash\n\n es-riak --show -b api_key -k DJFLPQSDJAUHLMLPDJIO\n \n {\n \"SCHEMA_VERSION\": \"0\",\n \"accessKey\": \"DJFLPQSDJAUHLMLPDJIO\",\n \"activationTimestamp\": 1368202730181,\n \"billingAccount\": 52901,\n \"customer\": 51400,\n \"description\": \"test key\",\n \"encryption\": \"TWO\",\n \"name\": \"Test\",\n \"network\": 50069,\n \"secretKey\": \"ee235a772d0def0b069d6364cda6a34e8d6d9eca6afcd94d37770e12c6d6d735df9a75fb64bd0a1cb18911a7ed4744fb\"\n }\n\nThere is no need to issue the show command first, I'm just doing it to highlight the differences.\n\nWith this information issue the command:\n\n.. code-block:: bash\n\n es-riak --elevate-api-key -b api_key -k DJFLPQSDJAUHLMLPDJIO\n \nThere will be no output from this command.\n\nbucket contents post-elevate:\n\n.. code-block:: bash\n\n es-riak --show -b api_key -k DJFLPQSDJAUHLMLPDJIO\n \n {\n \"SCHEMA_VERSION\": \"0\",\n \"accessKey\": \"DJFLPQSDJAUHLMLPDJIO\",\n \"activationTimestamp\": 1368202730181,\n \"billingAccount\": 52901,\n \"customer\": 51400,\n \"customerManagementKey\": true,\n \"description\": \"test key\",\n \"encryption\": \"TWO\",\n \"name\": \"Test\",\n \"network\": 50069,\n \"secretKey\": \"ee235a772d0def0b069d6364cda6a34e8d6d9eca6afcd94d37770e12c6d6d735df9a75fb64bd0a1cb18911a7ed4744fb\",\n \"systemManagementKey\": true\n }", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://pypi.python.org/pypi/riak_cli_tool", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "riak_cli_tool", "package_url": "https://pypi.org/project/riak_cli_tool/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/riak_cli_tool/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://pypi.python.org/pypi/riak_cli_tool" }, "release_url": "https://pypi.org/project/riak_cli_tool/0.1.7/", "requires_dist": null, "requires_python": null, "summary": "Riak tool", "version": "0.1.7" }, "last_serial": 798964, "releases": { "0.1.4": [ { "comment_text": "", "digests": { "md5": "145f168f7f455b133e0ffa3215fbb063", "sha256": "70a37d01be4e2945ccbfcbf5ee94f1d0969419e3d2c7ab555cc34bb3dd05b513" }, "downloads": -1, "filename": "riak_cli_tool-0.1.4.tar.gz", "has_sig": false, "md5_digest": "145f168f7f455b133e0ffa3215fbb063", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5882, "upload_time": "2013-05-10T18:00:33", "url": "https://files.pythonhosted.org/packages/5a/2c/c2b166e1cad43296d3d29962c64f719eb313e61d47e1b23fef547ba15700/riak_cli_tool-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "549ecc54cc2135a92417797bc7a7e1fc", "sha256": "874f6b9b03f53c7823ae30581c665001bcb81eca489cc6f9e52c6e3aee677d9e" }, "downloads": -1, "filename": "riak_cli_tool-0.1.5.tar.gz", "has_sig": false, "md5_digest": "549ecc54cc2135a92417797bc7a7e1fc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5953, "upload_time": "2013-05-10T18:06:40", "url": "https://files.pythonhosted.org/packages/da/02/f695f9f15f14b399517e4a8a4fd3b1be620b245603be3da2729f72a7591c/riak_cli_tool-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "d688c02c10fc9d2d98e173375a7501a2", "sha256": "937812f9e880ff042e27db874253c00275fd7bc014200c098517cf4fb1bd12c3" }, "downloads": -1, "filename": "riak_cli_tool-0.1.6.tar.gz", "has_sig": false, "md5_digest": "d688c02c10fc9d2d98e173375a7501a2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5957, "upload_time": "2013-05-10T18:21:00", "url": "https://files.pythonhosted.org/packages/53/d1/2981b2d1f6c314035c9d1cc60af1d3e9b834ffa0802a4fa7889f5017cffa/riak_cli_tool-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "3032543b84e38a9c06b7dc3f4ce75a74", "sha256": "76e0cdaed00ef3c3d179b8c7836a66c2dc7070bf02784d768e6dd66504e28c11" }, "downloads": -1, "filename": "riak_cli_tool-0.1.7.tar.gz", "has_sig": false, "md5_digest": "3032543b84e38a9c06b7dc3f4ce75a74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7211, "upload_time": "2013-05-22T16:59:16", "url": "https://files.pythonhosted.org/packages/89/b9/119fd2e880f531fdef69707c80966e8e84cf9343e85feb531c48af4efe97/riak_cli_tool-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3032543b84e38a9c06b7dc3f4ce75a74", "sha256": "76e0cdaed00ef3c3d179b8c7836a66c2dc7070bf02784d768e6dd66504e28c11" }, "downloads": -1, "filename": "riak_cli_tool-0.1.7.tar.gz", "has_sig": false, "md5_digest": "3032543b84e38a9c06b7dc3f4ce75a74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7211, "upload_time": "2013-05-22T16:59:16", "url": "https://files.pythonhosted.org/packages/89/b9/119fd2e880f531fdef69707c80966e8e84cf9343e85feb531c48af4efe97/riak_cli_tool-0.1.7.tar.gz" } ] }