{ "info": { "author": "Matt Ward", "author_email": "matt.ward@alfresco.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "ACS-CLI\n=======\n\nWhat is it?\n-----------\n\nA command line tool for accessing Alfresco Content Services repository\nservers through the public REST APIs.\n\nThe motivation for building this tool is two-fold: firstly as an\ninteresting way for me to learn python; and secondly it's the tool I\nalways wish existed. The code probably isn't very *pythonic* or well\norganised, but hopefully this will get better :-)\n\nInstallation\n------------\n\nUse (python3) pip to install:\n\n::\n\n pip3 install acs-cli\n\nTo try this out in docker with a self-destructing temporary container:\n\n::\n\n mward@holly:~$ docker run -it --rm ubuntu:16.04\n root@f957e9b7154f:/# apt update && apt install -y python3 python3-pip\n root@f957e9b7154f:/# pip3 install acs-cli\n\n\nWarning\n-------\n\nThis is a proof of concept and must be considered *alpha* quality\nsoftware at best.\n\nGetting help\n------------\n\nYou can ask for help at the program, API/command or subcommand levels, for example:\n\n::\n\n # Get help on the program:\n $ acs --help\n\n # Get help on using the sites API:\n $ acs sites --help\n\n # Get help on using list-sites:\n $ acs sites list-sites --help\n\n # Get help on using the login command:\n $ acs login --help\n\nShell tab completion\n--------------------\n\nTab completion can be enabled by adding the following to your ``.bashrc``:\n\n::\n\n eval \"$(register-python-argcomplete acs)\"\n\nExample usage\n-------------\n\nWithout any arguments, you may log in to http://localhost:8080/alfresco\nusing the username 'admin' and will be prompted for a password.\n\n::\n\n mward@holly:~$ acs login\n Logging in admin to http://localhost:8080/alfresco\n Password:\n mward@holly:acs-cli$\n\nUse the ``--username`` or ``--password`` options to log in with\ndifferent credentials:\n\n::\n\n mward@holly:~$ acs login --username=asmith --password=ban4n4@!\n\nOnce logged in, APIs may be exercised by using the general format:\n\n::\n\n acs api-collection api-command [options...] \n\nHere we see site creation:\n\n::\n\n mward@holly:~$ acs sites create-site --id accounting --title 'Accounting Collaboration' --description 'Site for collaboration relating to the accounting process' --visibility PRIVATE\n {\n \"entry\": {\n \"id\": \"accounting\",\n \"guid\": \"ee6d721d-e3b0-4299-a51f-afd4b59bfece\",\n \"visibility\": \"PRIVATE\",\n \"preset\": \"site-dashboard\",\n \"description\": \"Site for collaboration relating to the accounting process\",\n \"title\": \"Accounting Collaboration\",\n \"role\": \"SiteManager\"\n }\n }\n\n...and here we see the people API being used to create a person entity:\n\n::\n\n mward@holly:~$ acs people create-person --id bsmith --first-name Brian --email brian.smith@example.com --password password --json-data '{ \"lastName\":\"Smith\", \"properties\":{\"papi:jabber\":\"myjabber@jabber.example.com\"} }'\n {\n \"entry\": {\n \"id\": \"bsmith\",\n \"company\": {},\n \"lastName\": \"Smith\",\n \"aspectNames\": [\n \"papi:comms\"\n ],\n \"firstName\": \"Brian\",\n \"properties\": {\n \"papi:jabber\": \"myjabber@jabber.example.com\"\n },\n \"enabled\": true,\n \"email\": \"brian.smith@example.com\",\n \"emailNotificationsEnabled\": true\n }\n }\n\nNote: the custom property ``papi:jabber`` has previously been enabled in this example, by installing a custom dynamic model into the repository server.\nThe custom model's properties/aspects are not normally available.\n\nThe ``--json-data`` property can carry an arbitrary JSON payload to be sent to the REST API endpoint. You can mix and match this with\nthe convenient named arguments (e.g. ``--email``), however if a key is supplied in both methods then an error will be raised.\n\nAll API operations accept the ``--query`` option to specify a JMESPath\nexpression. Here for example, we choose to only display the ``id`` and\n``email`` fields of the returned ``entry`` object:\n\n::\n\n mward@holly:~$ acs people get-person --person-id=jbloggs --query 'entry.[id,email]'\n [\n \"jbloggs\",\n \"jbloggs@example.com\"\n ]\n\nAnd here, we use the ``--query`` option to view ``id``, ``firstName``\nand ``email`` of *each* entry in the list of people:\n\n::\n\n mward@holly:~$ acs people list-people --query='list.entries[].entry.[id,firstName,email]'\n [\n [\n \"admin\",\n \"Administrator\",\n \"admin@alfresco.com\"\n ],\n [\n \"guest\",\n \"Guest\",\n null\n ],\n [\n \"jbloggs\",\n \"Joe\",\n \"jbloggs@example.com\"\n ]\n ]\n\nAny *list* operation that may be paged can be used with the\n``--max-items`` and ``--skip-count`` options, used here to show two\nresults after skipping the first 4. This may be thought of as showing\nthe *third* page of results.\n\n::\n\n mward@holly:~$ acs people list-people --query='list.entries[].entry.[firstName]' --max-items=2 --skip-count=4\n [\n [\n \"Joe10\"\n ],\n [\n \"Joe11\"\n ]\n ]\n\nThe ``sites list-sites`` API command may be used to list \"sites\".\nThis is a paged API and here we use it without the\n``--max-items`` and ``--skip-count`` options which default to 10 and 0\nrespectively:\n\n::\n\n mward@holly:~$ acs sites list-sites --query='list.entries[].entry'\n [\n {\n \"title\": \"accounts\",\n \"role\": \"SiteManager\",\n \"guid\": \"80dbd63c-3dbf-4005-bd16-e324fa8b4517\",\n \"id\": \"accounts\",\n \"visibility\": \"PUBLIC\",\n \"preset\": \"site-dashboard\"\n },\n {\n \"title\": \"Sample: Web Site Design Project\",\n \"guid\": \"b4cff62a-664d-4d45-9302-98723eac1319\",\n \"id\": \"swsdp\",\n \"visibility\": \"PUBLIC\",\n \"description\": \"This is a Sample Alfresco Team site.\",\n \"preset\": \"site-dashboard\"\n }\n ]\n\nIn this example, we create a folder within the \"My Files\" folder for jbloggs:\n\n::\n\n mward@holly:~$ acs nodes create-node --node-id=-my- --node-type=cm:folder --name=my_notes --json-data '{\"properties\":{\"cm:title\":\"My daily notes\"}}'\n {\n \"entry\": {\n \"createdByUser\": {\n \"displayName\": \"Joe Bloggs\",\n \"id\": \"jbloggs\"\n },\n \"modifiedAt\": \"2017-04-07T13:36:55.848+0000\",\n \"id\": \"190a4896-1492-4142-9cd3-7f80d8012514\",\n \"createdAt\": \"2017-04-07T13:36:55.848+0000\",\n \"modifiedByUser\": {\n \"displayName\": \"Joe Bloggs\",\n \"id\": \"jbloggs\"\n },\n \"properties\": {\n \"cm:title\": \"My daily notes\"\n },\n \"name\": \"my_notes\",\n \"aspectNames\": [\n \"cm:titled\",\n \"cm:auditable\"\n ],\n \"isFile\": false,\n \"isFolder\": true,\n \"parentId\": \"29dd6a63-da4c-4f96-8edb-ad9808fa198b\",\n \"nodeType\": \"cm:folder\"\n }\n }\n\nThe alias ``-my-`` is used for the node where the child folder will be created.\n\nThe common server-side filtering and projection API parameters are supported, using similarly named command line\noptions such as ``--include``, ``--fields`` and ``--where``.\nFor example, we can use the where clause to view site membership of PRIVATE sites, and restrict\nthe returned fields to ``role`` and ``id``:\n\n::\n\n mward@holly:~$ acs sites list-site-memberships --person-id admin --where=\"(visibility='PUBLIC')\" --fields=id,role\n {\n \"list\": {\n \"pagination\": {\n \"count\": 19,\n \"totalItems\": 19,\n \"hasMoreItems\": false,\n \"maxItems\": 100,\n \"skipCount\": 0\n },\n \"entries\": [\n {\n \"entry\": {\n \"role\": \"SiteManager\",\n \"id\": \"swsdp\"\n }\n },\n {\n \"entry\": {\n \"role\": \"SiteManager\",\n \"id\": \"site-e26b050b\"\n }\n },\n {\n \"entry\": {\n ...\n\nYou may ask what the difference between these and the ``--query`` options are. The ``--query`` option provides support\nfor post-response filtering and manipulation through the JMESPath query language. JMESPath is a very powerful yet\nsimple way to manipulate the response object but since it is performed as a post-response processing stage, may affect\npaging (e.g. the paging details may say that there are more results than are present in the final results). Also by\nusing the server-side functionality of ``include``, ``fields`` and ``where``, you may conserve bandwidth by reducing the\nnumber of results transmitted \"over the wire\".", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://git.alfresco.com/mward/acs-cli", "keywords": "alfresco acs rest cli", "license": "", "maintainer": "", "maintainer_email": "", "name": "acs-cli", "package_url": "https://pypi.org/project/acs-cli/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/acs-cli/", "project_urls": { "Homepage": "https://git.alfresco.com/mward/acs-cli" }, "release_url": "https://pypi.org/project/acs-cli/0.0.9/", "requires_dist": [ "argcomplete", "jmespath", "requests", "check-manifest; extra == 'dev'", "coverage; extra == 'test'" ], "requires_python": "", "summary": "A command line interface to the Alfresco Content Services REST API", "version": "0.0.9" }, "last_serial": 2834364, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "0fcc7f0da02a38108ddc9e2ddf28dcb8", "sha256": "204d1b66df29e1f6ca0fe270c2fe97c0ee10d0da0e62d88d4a52a9bd639799d9" }, "downloads": -1, "filename": "acs_cli-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "0fcc7f0da02a38108ddc9e2ddf28dcb8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11926, "upload_time": "2017-03-31T16:33:17", "url": "https://files.pythonhosted.org/packages/b7/89/e02016235c9bf8626bcc3a74b0493438d0eb6a5eb6be62ad22e600346315/acs_cli-0.0.2-py3-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "b3895917a13d980af62eb86b80a27050", "sha256": "39144ecd442a118ec74bfbff8988fdaaa2dde1ec8929b5e9abbc63280043778f" }, "downloads": -1, "filename": "acs_cli-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "b3895917a13d980af62eb86b80a27050", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12583, "upload_time": "2017-04-01T13:37:30", "url": "https://files.pythonhosted.org/packages/4d/a5/dfaf9eb011e9e5cc197f83c501ca30729a83cff002467665d6d4aea58eca/acs_cli-0.0.3-py3-none-any.whl" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "c34d36e39c9608714af812b560f1d56a", "sha256": "359b1db2c17fa79ec63932586e52353ad79c655cb2a11f7a8e9830a352f6cd46" }, "downloads": -1, "filename": "acs_cli-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "c34d36e39c9608714af812b560f1d56a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12975, "upload_time": "2017-04-02T18:41:06", "url": "https://files.pythonhosted.org/packages/a6/55/62d56c2aadda1ea1e1f20981174adc92fcbcc035dd6253a4d79760490c8d/acs_cli-0.0.4-py3-none-any.whl" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "ed39a5f50157225d298f862d1d4516f7", "sha256": "e901bf98000e819785ea52d883a1b04145fd67d060b2a266ff445d89e4083d12" }, "downloads": -1, "filename": "acs_cli-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "ed39a5f50157225d298f862d1d4516f7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13021, "upload_time": "2017-04-02T18:51:35", "url": "https://files.pythonhosted.org/packages/0a/93/d71c955cdb8c42e5a569c40260d51068ca91421289e1f2f50f4bb5f84015/acs_cli-0.0.5-py3-none-any.whl" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "54a93aa72052e090d9fe123f46f97663", "sha256": "46d300c0813f2e93664071e620741e7086949f867a801de4da795f174d9922c2" }, "downloads": -1, "filename": "acs_cli-0.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "54a93aa72052e090d9fe123f46f97663", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18449, "upload_time": "2017-04-07T15:54:35", "url": "https://files.pythonhosted.org/packages/1b/0e/0fd5b259e610daa06c2ffb053c79b1d9909880bb2afee110b81007729c27/acs_cli-0.0.6-py3-none-any.whl" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "2cfe66c8c7f846193aa5e837dd8ce15a", "sha256": "aaa18bc225c529aea57c2082de72655e082c9e67e1c1e640ff67293deba3d083" }, "downloads": -1, "filename": "acs_cli-0.0.7-py3-none-any.whl", "has_sig": false, "md5_digest": "2cfe66c8c7f846193aa5e837dd8ce15a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18753, "upload_time": "2017-04-12T09:58:36", "url": "https://files.pythonhosted.org/packages/27/61/d2a9873f5ea76dc76a0bed720eae7bca25ca459d9c2ac84a844087a91f6c/acs_cli-0.0.7-py3-none-any.whl" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "7cdccb95431ef5272f58e946906b86f9", "sha256": "98e58c17e9cf7963f99fc0dd024463d05f483c18018a7e2576c8de25db12dc2d" }, "downloads": -1, "filename": "acs_cli-0.0.8-py3-none-any.whl", "has_sig": false, "md5_digest": "7cdccb95431ef5272f58e946906b86f9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22546, "upload_time": "2017-04-21T18:34:44", "url": "https://files.pythonhosted.org/packages/ed/15/418fba852739588ab7ba9b8e2aec4e8c2f62c7316161d6eb0abde35fd4fe/acs_cli-0.0.8-py3-none-any.whl" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "f6ba9c9f90ac41be21af1a34aa29dfe6", "sha256": "23a047f6666442c9da2cf921ac712d7c8f04bd1286cb460fc47ecc66e9caf877" }, "downloads": -1, "filename": "acs_cli-0.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "f6ba9c9f90ac41be21af1a34aa29dfe6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22740, "upload_time": "2017-04-27T12:48:01", "url": "https://files.pythonhosted.org/packages/84/c3/9e3955913f3bbdab6f5250164f06471b48c24195c86f5150c8171b698815/acs_cli-0.0.9-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6ba9c9f90ac41be21af1a34aa29dfe6", "sha256": "23a047f6666442c9da2cf921ac712d7c8f04bd1286cb460fc47ecc66e9caf877" }, "downloads": -1, "filename": "acs_cli-0.0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "f6ba9c9f90ac41be21af1a34aa29dfe6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 22740, "upload_time": "2017-04-27T12:48:01", "url": "https://files.pythonhosted.org/packages/84/c3/9e3955913f3bbdab6f5250164f06471b48c24195c86f5150c8171b698815/acs_cli-0.0.9-py3-none-any.whl" } ] }