{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# Python Distelli\n\nThis is a client for the Distelli REST API. It currently allows you to fetch existing app info, as well as create and delete applications.\n\n### Getting started\n\n`distelli-python` depends on the `requests` library.\n\nInstall the library:\n\n pip install distelli\n\nImport the module:\n\n\tfrom distelli import Distelli\n\nProvide username and api\\_token credentials:\n\n client = Distelli(username=YOUR_USERNAME, api_token=YOUR_API_TOKEN)\n\nOr set environment variables:\n\n export DISTELLI_USERNAME=YOUR_USERNAME\n export DISTELLI_API_TOKEN=YOUR_API_TOKEN\n\nConstruct `Distelli` without any credentials:\n\n client = Distelli()\n\n## Application operations\n\n### View your existing applications:\n\nJust run:\n\n\tapps = client.apps()\n\nResults appear as a Python dict:\n\n [{'api_url': 'https://api.distelli.com/youraccount/apps/test_app',\n 'builds_url': 'https://api.distelli.com/youraccount/apps/test_app/builds',\n 'created': '2016-12-30T18:07:50.284Z',\n 'deployments_url': 'https://api.distelli.com/youraccount/apps/test_app/deployments',\n 'description': None,\n 'html_url': 'https://www.distelli.com/youraccount/apps/test_app',\n 'latest_build': None,\n 'latest_release': None,\n 'name': 'test_app',\n 'owner': 'youraccount',\n 'releases_url': 'https://api.distelli.com/youraccount/apps/test_app/releases'},\n {'api_url': 'https://api.distelli.com/youraccount/apps/test_app2',\n 'builds_url': 'https://api.distelli.com/youraccount/apps/test_app2/builds',\n 'created': '2016-12-30T18:24:07.511Z',\n 'deployments_url': 'https://api.distelli.com/youraccount/apps/test_app2/deployments',\n 'description': 'Another test app',\n 'html_url': 'https://www.distelli.com/youraccount/apps/test_app2',\n 'latest_build': None,\n 'latest_release': None,\n 'name': 'test_app2',\n 'owner': 'youraccount',\n 'releases_url': 'https://api.distelli.com/youraccount/apps/test_app2/releases'}]\n\n### Get details for a specific application\n\n\tclient.app('test_app2')\n\nResults are the same as `apps()` above, but only show the app specified.\n\n### Create an application\n\n client.create_app('test_app3', 'Description of the application')\n\nResults are the same as `app()` above, but only show the app that was added.\n\n### Delete an application\n\n client.delete_app('test_app3')\n\n## Environments operations\n\n### View your existing environments:\n\nJust run:\n\n\tenvs = client.envs()\n\nResults appear as a Python dict:\n\n [{'active_release_url': 'https://api.distelli.com/youraccount/apps/demo-app/releases/v1',\n 'active_release_version': 'v1',\n 'api_url': 'https://api.distelli.com/youraccount/envs/demo-app-dev',\n 'app_name': 'demo-app',\n 'app_url': 'https://api.distelli.com/youraccount/apps/demo-app',\n 'deployments_url': 'https://api.distelli.com/youraccount/envs/demo-app-dev/deployments',\n 'description': None,\n 'html_url': 'https://www.distelli.com/youraccount/envs/demo-app-dev',\n 'last_deployment_url': 'https://api.distelli.com/youraccount/deployments/121509',\n 'name': 'demo-app-dev',\n 'owner': 'youraccount',\n 'server_count': 1,\n 'servers_url': 'https://api.distelli.com/youraccount/envs/demo-app-dev/servers',\n 'settings_url': 'https://api.distelli.com/youraccount/envs/demo-app-dev/settings',\n 'tags': [],\n 'vars': [{'name': 'ENV_FOLDER', 'value': '\"/var/conf/env/dev\"'}]},\n {'active_release_url': 'https://api.distelli.com/youraccount/apps/demo-app/releases/v1',\n 'active_release_version': 'v1',\n 'api_url': 'https://api.distelli.com/youraccount/envs/demo-app-preview',\n 'app_name': 'demo-app',\n 'app_url': 'https://api.distelli.com/youraccount/apps/demo-app',\n 'deployments_url': 'https://api.distelli.com/youraccount/envs/demo-app-preview/deployments',\n 'description': None,\n 'html_url': 'https://www.distelli.com/youraccount/envs/demo-app-preview',\n 'last_deployment_url': 'https://api.distelli.com/youraccount/deployments/121515',\n 'name': 'demo-app-preview',\n 'owner': 'youraccount',\n 'server_count': 1,\n 'servers_url': 'https://api.distelli.com/youraccount/envs/demo-app-preview/servers',\n 'settings_url': 'https://api.distelli.com/youraccount/envs/demo-app-preview/settings',\n\n### Get details for a specific environment\n\n\tclient.env('demo-app-preview')\n\nResults are the same as `envs()` above, but only show the app specified.\n\n### Create an environment\n\n client.create_env('demo-app-live', 'Description of the environment')\n\nResults are the same as `env()` above, but only show the environment that was added.\n\n### Delete an environment\n\n client.delete_env('demo-app-live')\n\n### Add servers to an environment\n\n client.add_env_servers('demo-app-live', ['server-id-1', 'server-id-2'])\n\n### Remove servers from an environment\n\n client.remove_env_servers('demo-app-live', ['server-id-1', 'server-id-2'])\n\n## Server operations\n\n### View your existing servers:\n\nJust run:\n\n\tenvs = client.servers()\n\nResults appear as a Python dict:\n\n [{'agent_version': '3.63',\n 'api_url': 'https://api.distelli.com/youraccount/servers/766b88c8-e925-11e4-ae8b-080027cc07f7',\n 'cloud_instance_id': None,\n 'cloud_location': None,\n 'cloud_provider': None,\n 'dns_name': 'demo-app-preview.youraccount.com',\n 'html_url': 'https://www.distelli.com/youraccount/servers/766b88c8-e925-11e4-ae8b-080027cc07f7',\n 'ip_addr': '192.168.1.112',\n 'is_healthy': 'true',\n 'mac_address': '08:00:27:cc:07:f7',\n 'os_name': 'Ubuntu',\n 'os_version': '14.04',\n 'server_id': '766b88c8-e925-11e4-ae8b-080027cc07f7',\n 'start_time': '2016-07-26T09:16:41.353Z',\n 'tags': ['becon', 'beta', 'preview']},\n {'agent_version': '3.66',\n 'api_url': 'https://api.distelli.com/youraccount/servers/a4d253a3-1668-e64b-86be-122d4227c561',\n 'cloud_instance_id': 'i-9b668b5317f00995d',\n 'cloud_location': 'eu-west-1',\n 'cloud_provider': 'Aws',\n 'dns_name': 'demo-app-live.youraccount.com',\n 'html_url': 'https://www.distelli.com/youraccount/servers/a4d253a3-1668-e64b-86be-122d4227c561',\n 'ip_addr': '10.226.127.83',\n 'is_healthy': 'false',\n 'mac_address': '12:2d:42:27:c5:61',\n 'os_name': 'Ubuntu',\n 'os_version': '14.04',\n 'server_id': 'a4d253a3-1668-e64b-86be-122d4227c561',\n 'start_time': '2016-12-20T19:39:32.835Z',\n 'tags': None}]\n\n### Get details for a specific server\n\n\tclient.server('a4d253a3-1668-e64b-86be-122d4227c561')\n\nResults are the same as `servers()` above, but only show the server specified.\n\n### Remove a server from your account\n\n\tclient.delete_server('a4d253a3-1668-e64b-86be-122d4227c561')\n\n## Testing\n\nTo run the tests you will need a Distelli account and you will need to know your Distelli username and API token. As described in https://www.distelli.com/docs/api/getting-started-with-distelli-api\n\nThe tests will create and remove artifacts in your account.\n\nCreate a virtualenv (e.g. `mkvirtualenv --python=$(which python3) distelli-python`)\n\nInstall the requirements. `pip install -r requirements.txt`\n\nRun the tests with your username and API token set using the environment variables `DISTELLI_TEST_USERNAME` and `DISTELLI_TEST_API_TOKEN`:\n\n DISTELLI_TEST_USERNAME= DISTELLI_TEST_API_TOKEN= make test", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/maxpeterson/distelli-python/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "distelli", "package_url": "https://pypi.org/project/distelli/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/distelli/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/maxpeterson/distelli-python/" }, "release_url": "https://pypi.org/project/distelli/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Client for Distelli REST API https://www.distelli.com/docs/api/", "version": "0.1.0" }, "last_serial": 2547634, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "790ad64ffefa7b61e902b16e37e87f3f", "sha256": "0136fb34a0ebd4c2833d583fbe2f48ab52a47df32a12532d93ddd44e0fc29266" }, "downloads": -1, "filename": "distelli-0.1.0.tar.gz", "has_sig": false, "md5_digest": "790ad64ffefa7b61e902b16e37e87f3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4748, "upload_time": "2016-12-31T18:15:50", "url": "https://files.pythonhosted.org/packages/8a/3d/823a449fb80836607b0d07505c208f4a255924e56171deac556c42e81f61/distelli-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "790ad64ffefa7b61e902b16e37e87f3f", "sha256": "0136fb34a0ebd4c2833d583fbe2f48ab52a47df32a12532d93ddd44e0fc29266" }, "downloads": -1, "filename": "distelli-0.1.0.tar.gz", "has_sig": false, "md5_digest": "790ad64ffefa7b61e902b16e37e87f3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4748, "upload_time": "2016-12-31T18:15:50", "url": "https://files.pythonhosted.org/packages/8a/3d/823a449fb80836607b0d07505c208f4a255924e56171deac556c42e81f61/distelli-0.1.0.tar.gz" } ] }