{ "info": { "author": "nine.ch", "author_email": "dev@nine.ch", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "=====\ndjango-netbox-graphql\n=====\n\nNetbox-Graphql is a simple Django app which provides a GraphQL API for Netbox.\nThis module is dockerized and **development of it is still in progress**. Netbox's circuit module with all it's models are covered.\nFor this part of app you can CRUD operations.\n\nAvailable Models for CRUD\n------------------------\n* CIRCUITS\n * Provider\n * Circuit\n * CircuitType\n * CircuitTermination\n* DCIM\n * Region\n * Site\n* TENANCY\n * TenantGroup\n * Tenant\n* IPAM\n * Role\n * VlanGroup\n * VLAN\n * VRF\n * RIR\n * Aggregate\n * Prefix\n* VIRTUALIZATION\n * ClusterType\n * ClusterGroup\n * Cluster\n * VirtualMachine\n\n\nBuild package (optional)\n------------------------\n\n| git clone https://github.com/ninech/django-netbox-graphql\n| cd django-netbox-graphql\n| python setup.py sdist\n\nThis module relies on modules\n-----------------------------\n| graphene-django>=1.0\n| django-filter>=1.0.2\n\nQuick start\n-----------\n\n1. Install module::\n\n pip install django-netbox-graphql #from external storage, not yet deployed\n or\n pip install dist/django-netbox-graphql-0.0.x.tar.gz\n\n2. Add below modules to your INSTALLED_APPS setting like this::\n\n INSTALLED_APPS = [\n ...\n 'graphene_django',\n 'netbox_graphql',\n ]\n\n3. Add graphene settings to netbox/setting.py::\n\n GRAPHIQL_ENABLED = True # optional, by default True, set False to disable it\n GRAPHENE = {\n 'SCHEMA' : 'netbox_graphql.schema.schema', #points to the netbox-graphql schema variable in schema.py\n 'SCHEMA_INDENT': 2, #defines the indentation space in the output\n }\n\n4. Include the polls URLconf in your project netbox/urls.py like this::\n\n url(r'^graphql', include('netbox_graphql.urls')),\n\n5. Visit http://127.0.0.1:8000/graphql to fetch records with graphql::\n\n curl -H 'Content-Type: application/json'\\\n -H \"Authorization: Token \"\\\n -XPOST -d '{\"query\":\"{ circuitTypes { edges { node { id name slug } } } }\"}' http://localhost:8000/graphql\n\nVisit http://localhost:8000/user/api-tokens/ to generate token\n\nGraphql CRUD examples\n---------------------\n\nCreate::\n\n curl -H 'Content-Type: application/json'\\\n -H \"Authorization: Token \"\\\n -XPOST -d '{\"query\":\"mutation { newCircuitType(input: {name: \\\"Type1\\\", slug: \\\"type1\\\"}) { circuitType { id name slug } } }\"}' http://localhost:8000/graphql\n\n {\"data\":{\"newCircuitType\":{\"circuitType\":{\"id\":\"Q2lyY3VpdFR5cGVOb2RlOjI1\",\"name\":\"Type1\",\"slug\":\"type1\"}}}}\nRead::\n\n curl -H 'Content-Type: application/json'\\\n -H \"Authorization: Token \"\\\n -XPOST -d '{\"query\":\"{ circuitTypes(id: \\\"\\\") { edges { node { id name slug } } } }\"}' http://localhost:8000/graphql\n\n {\"data\":{\"circuitTypes\":{\"edges\":[{\"node\":{\"id\":\"Q2lyY3VpdFR5cGVOb2RlOjI0\",\"name\":\"Type\",\"slug\":\"type\"}}]}}}\nUpdate::\n\n curl -H 'Content-Type: application/json'\\\n -H \"Authorization: Token \"\\\n -XPOST -d '{\"query\":\"mutation { updateCircuitType(input: {id:\\\"\\\", name: \\\"TypeX\\\", slug: \\\"typeX\\\"}) { circuitType { slug name slug } } }\"}' http://localhost:8000/graphql\n\n {\"data\":{\"updateCircuitType\":{\"circuitType\":{\"id\":\"Q2lyY3VpdFR5cGVOb2RlOjI0\",\"name\":\"TypeX\",\"slug\":\"typeX\"}}}}\n\nDelete::\n\n curl -H 'Content-Type: application/json'\\\n -H \"Authorization: Token \"\\\n -XPOST -d '{\"query\":\"mutation { deleteCircuitType(input: {id:\\\"\\\"}) { circuitType { name slug } } }\"}' http://localhost:8000/graphql\n\n {\"data\":{\"deleteCircuitType\":{\"circuitType\":{\"name\":\"TypeX\",\"slug\":\"typeX\"}}}}\n\nGraphql editor for writing queries\n----------------------------------\n\n1. You should have installed `graphene_django`::\n\n INSTALLED_APPS = [\n ...\n 'graphene_django',\n ]\n\n2. Create url for graphql client with adding new link in `urls.py` ::\n\n url(r'^graphql/client', GraphQLView.as_view(graphiql=True)),\n\n3. Visit http://127.0.0.1:8000/graphql/client ::\n\n.. image:: https://s11.postimg.org/5vi9lmn1f/django-netbox-graphql.png\n\nExamples for module Circuit\n---------------------------\n\nAll examples are available `here `_\n\nPackaging and deploying to pypi.python.org\n-----------------------------------------------\nThe simplest way to make package and deploy it is with using `twine`::\n\n pip install twine # install twine\n python setup.py sdist # build django-netbox-graphql-X.X.X.tar.gz\n twine upload dist/django-netbox-graphql-X.X.X.tar.gz\n\n\nTests\n-----\nRun unit tests::\n\n docker-compose run netbox ./manage.py test # runs all tests\n docker-compose run netbox ./manage.py test netbox_graphql/ # runs only netbox_graphql module tests\n\n # At the end, you can stop any running service and cleanup as follows:\n docker-compose down\n\nPYPI Distribution\n-----------------\n\nCan be found at https://pypi.python.org/pypi?:action=display&name=django-netbox-graphql\n\nAbout\n-----\nThis module is currently maintained and funded by `nine `_\n\n.. image:: https://logo.apps.at-nine.ch/Dmqied_eSaoBMQwk3vVgn4UIgDo=/trim/500x0/logo_claim.png\n :target: https://nine.ch", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ninech/django-netbox-graphql", "keywords": "django netbox graphql python", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-netbox-graphql", "package_url": "https://pypi.org/project/django-netbox-graphql/", "platform": "", "project_url": "https://pypi.org/project/django-netbox-graphql/", "project_urls": { "Homepage": "https://github.com/ninech/django-netbox-graphql" }, "release_url": "https://pypi.org/project/django-netbox-graphql/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Django module which provides a GraphQL API for Netbox (For django 1.11)", "version": "0.0.4" }, "last_serial": 3584342, "releases": { "0.0.3": [ { "comment_text": "", "digests": { "md5": "007659dd4f67562716ed5be34701f404", "sha256": "6f15b3804061e040293b88825b8f6b4d28702c0599edc61df90b61dcc3e73e64" }, "downloads": -1, "filename": "django-netbox-graphql-0.0.3.tar.gz", "has_sig": false, "md5_digest": "007659dd4f67562716ed5be34701f404", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8469, "upload_time": "2017-08-16T09:33:03", "url": "https://files.pythonhosted.org/packages/1d/9e/6811a97062614544b3cabde553e7b00f049539640543f154efa1a67f580e/django-netbox-graphql-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "4ee912aee3984335ba36b10db88f5cd1", "sha256": "f58542c50c0aaebda05a02ff1571c403cbfd04022f00ab91a3a442788170fd23" }, "downloads": -1, "filename": "django-netbox-graphql-0.0.4.tar.gz", "has_sig": false, "md5_digest": "4ee912aee3984335ba36b10db88f5cd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22722, "upload_time": "2018-02-15T13:23:17", "url": "https://files.pythonhosted.org/packages/c1/73/29788da575338c997bfd9a2b6e072a54ae0aa4639d3f11a19f9f8ea24fe0/django-netbox-graphql-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4ee912aee3984335ba36b10db88f5cd1", "sha256": "f58542c50c0aaebda05a02ff1571c403cbfd04022f00ab91a3a442788170fd23" }, "downloads": -1, "filename": "django-netbox-graphql-0.0.4.tar.gz", "has_sig": false, "md5_digest": "4ee912aee3984335ba36b10db88f5cd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22722, "upload_time": "2018-02-15T13:23:17", "url": "https://files.pythonhosted.org/packages/c1/73/29788da575338c997bfd9a2b6e072a54ae0aa4639d3f11a19f9f8ea24fe0/django-netbox-graphql-0.0.4.tar.gz" } ] }