{
"info": {
"author": "",
"author_email": "",
"bugtrack_url": null,
"classifiers": [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7"
],
"description": "# pytglue\nUnofficial Python Wrapper for IT Glue. \n\nIt goes without saying, but you are responsible for your own environment. It is possible to cause major issues with your \nITGlue data while using the API if you are not careful. \n\n## Requirements: \nRequests\n\n## Installation:\n```\npip install pytglue\n```\n\n## Usage:\n\n```\nfrom pytglue import pytglue\n```\n\n### Connecting to ITGlue:\nAn API key is required from ITGlue to connect. \n\n```\nPytglue = pytglue(apikey)\n```\nBy default, the IDs for the following items are queried for use with the convert_to_id function. This allows you to update, filter, and create using the name of the item rather than the IT Glue ID. \n\n* Organization Names\n* Organization Statuses\n* Organization Types\n* Configuration Types\n* Configuration Statuses\n* Flexible Asset Types\n* Contact Types\n* Manufacturers\n* Models\n* Password Categories\n* Countries\n* Regions\n\n\n\nThis does result in additional calls to ITGlue that may be unnecessary. To bypass this you can use use the following command. Anything that utilizes the convert_to_id function will result in errors. \n```\nPytglue = pytglue(apikey, load_id=False)\n```\n\n### Queries and Filters\nPytglue can query the following items:\n* Configurations\n* Flexible Assets\n* Organizations\n* Contacts\n\nArgument must be one of 'Configurations', 'Flexible Assets', 'Organizations', 'Contacts'\n```\nPytglue.Query('Configurations')\n```\n\nFiltering can be done with either the specific ID or the exact name using the convert_to_id function. Currently the \"Sort\" and\n\"Page\" functions from the IT Glue API are not supported, however all matching items are returned, not just the first 50. \n\nAll Include values are boolian and IT Glue will only recognize one. \n\nAcceptable values for filtering are: \n##### Configurations \n**Filter**\n* id\n* name\n* org (Can be the ID or exact name of an Organization)\n* configType (Can be the ID or exact name of a Configuration Type)\n* configStatus (Can be the ID or exact name of a Configuration Status)\n* contactID\n* serial\n* rmmID\n* rmm\n\n**Include**\n* interfaces\n* rmmRecord\n* password\n* attachments\n* relatedItems\n* updated\n* location\n\n##### Flexible Assets\n**Filter**\n* FlexibleAssetType (Can be the ID or exact name of the Flexible Asset Type)\n* name\n* org (Can be the ID or exact name of an Organization)\n\n**Include**\n* password\n\n##### Organizations\n**Filter**\n* id\n* name\n* orgType (Can be the ID or the exact name of the Organization Type)\n* orgStatus (Can be the ID or the exact name of the Organization Status)\n* created\n* updated\n* excludeID\n* excludeName\n* excludeOrgType (Can be the ID or the exact name of the Organization Type)\n* excludeOrgStatus (Can be the ID or the exact name of the Organization Status)\n\n##### Contacts\n**Filter**\n* org (Can be the ID or exact name of an Organization)\n* firstName\n* lastName\n* title\n* contactType (Can be the ID or exact name of a Contact Type)\n* firstName\n* important\n* primaryEmail\n\n**Include**\n* location\n* password\n\n```\nPytglue.Filter(configType='Firewall', configStatus='Active', interfaces=True)\n```\n\nTo Query the data, use the Get function. \n\n```\nPytglue.Get()\n```\n\nTo return the latest Get data for use outside of the wrapper. \n\n```\ndata = Pytglue.rawdata\n```\n\n### CRUD\n\n**At this time Creating is only supported for Configurations, and Deleting is not supported at all**\n\nWorking with data is done within the class specific to the for the type of data. \n\n```\nPytglue.Configurations.something\nPytglue.FlexibleAssets.something\nPytglue.Organizations.somethin\nPytglue.Contacts.Something\n```\n\n#### Printing\n```\nPytglue.Configurations.Print()\nPytglue.Configurations.PrintAll()\n```\n\n#### Selecting\n```\nPytglue.Configurations.SelectNext()\n```\n\nSelectNext() returns a true or false value dictating whether it is selecting the final item queried.\nOnce the final item is selected it resets back to the first item. \nTo loop through all items you can use a while loop.\n\n```\nlastitem = False\nwhile not lastitem: \n Pytglue.Configurations.item['configuration-status-name'] = 'Active'\n lastitem = Pytglue.Configurations.SelectNext()\n```\n\n#### Searching\nSearching can be performed on any single value returned. If multiple items meet the requirements of the search, \nonly the first result is returned. After searching, the selected item is the item that was found. An error is returned if \nno matches are found. \n\n```\nPytglue.Configurations.Search(id=12345)\n```\n\n#### Clear\nClear() is used to reset the query results. This will need to be run to perform another query of the same type. \nFuture versions will need allow queries to be stacked ex. filtering for Firewalls and the filtering for Routers\nand then combining the results. That does not work yet so Clear() must be used to prevent errors. \n\n```\nPytglue.Configurations.Clear()\n```\n\n\n#### Modifying Data\n\nThe data is stored in a list of dictionaries, with the dictonary keys being the key returned from IT Glue. \nData returned using 'Include' is has the include value appended to the key. \nTo modify the selected item:\n\n```\nPytglue.Configurations.item['name'] = 'A new name'\nPytglue.Configurations.item['configuration-interfaces-name'] = 'Another new name' \n```\n\nCalling SelectNext() or Update() checks the item for any changes since it was initially selected. \nIf there are any changes, they are queued to be updated. Calling Update() will update all modified \nitems in the queue of that class. e.g. Calling Update() in Configurations will not update Flexible Assets. \nThis can result in a large API call and cause a timeout error. In the future I would like to get Update()\nto break it into smaller requests, but that does not happen at this time. \n```\nPytglue.Configurations.Update()\n```\n\n##### **A Few Notes About Flexible Assets**\n* Because Flexible Assets keys can be any value and because in Flexible Assets an empty field returns no value, there \n is no built in check to ensure you are entering a valid key. \n* Unlike the IT Glue API Documentation, you *can* modify a single value in a Flexible Asset without entering all fields.\n This is done by copying any unmodified fields to send in the update call. \n* Tagged fields are returned as dictionaries, but a list of IDs must be provided in order for them to be updated. \n\n#### Creating Data\nAt this time, only Configurations can be created. \nCreate() uses an empty 'item' dictionary with all editable values empty. \nPrint, PrintAll, and convert_to_id work within create. If convert_to_id is used, and an ID is given for the corresponding\nfield, the value from convert_to_id takes precedence. \n\nPost() is used to post the items to IT Glue.\n\nConfiguration Interfaces accepts lists of multiple values. \n\n```\nPytglue.Configurations.Create.item['organization-name'] = 'Happy Frog'\nPytglue.Configurations.Create.item['configuration-type-name'] = 'Managed Server'\nPytglue.Configurations.Create.item['name'] = 'HF-SF-CJ452JK'\nPytglue.Configurations.Create.item['hostname'] = 'HFSFCJ452JK'\nPytglue.Configurations.Create.item['configuration-status-name'] = 'Active'\nPytglue.Configurations.Create.item['configuration-interfaces-ip-address'] = ['192.168.1.200', '192.168.1.201']\nPytglue.Configurations.Create.item['configuration-interfaces-primary'] = [True, False]\nPytglue.Configurations.Create.item['configuration-interfaces-name'] = ['NIC1', 'NIC2']\nPytglue.Configurations.Create.Next()\nPytglue.Configurations.Create.item['organization-name'] = 'Happy Frog'\nPytglue.Configurations.Create.item['configuration-type-name'] = 'Managed Server'\nPytglue.Configurations.Create.item['name'] = 'HF-NY-CJ452JK'\nPytglue.Configurations.Create.item['hostname'] = 'HFNYCJ452JK'\nPytglue.Configurations.Create.item['configuration-status-name'] = 'Active'\nPytglue.Configurations.Create.item['configuration-interfaces-ip-address'] = ['192.168.2.200', '192.168.2.201']\nPytglue.Configurations.Create.item['configuration-interfaces-primary'] = [True, False]\nPytglue.Configurations.Create.item['configuration-interfaces-name'] = ['NIC1', 'NIC2']\nPytglue.Configurations.Post()\n```\n\n\n",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "",
"keywords": "",
"license": "",
"maintainer": "",
"maintainer_email": "",
"name": "pytglue",
"package_url": "https://pypi.org/project/pytglue/",
"platform": "",
"project_url": "https://pypi.org/project/pytglue/",
"project_urls": null,
"release_url": "https://pypi.org/project/pytglue/1.0.2/",
"requires_dist": null,
"requires_python": "",
"summary": "An Unofficial Python Wrapper for ITGlue.",
"version": "1.0.2"
},
"last_serial": 4590750,
"releases": {
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "5d3e6bfc9b36be56fed2fd9a684de7f8",
"sha256": "394046f9eb03b1f8dea3a7ee78a71846cc39a4fadad286c40eed77cd7215a6f7"
},
"downloads": -1,
"filename": "pytglue-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5d3e6bfc9b36be56fed2fd9a684de7f8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 22897,
"upload_time": "2018-12-10T17:33:44",
"url": "https://files.pythonhosted.org/packages/59/f4/f92defe3fcf0502a2ebf5ae874261716ed3334f2856eb430ced186833fd0/pytglue-1.0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "8a9ff61d0678ba4e4189df5553832fe7",
"sha256": "b6413e335d43af345b7a522b963305c9253e9fd96e129e25d387da2108302bc3"
},
"downloads": -1,
"filename": "pytglue-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "8a9ff61d0678ba4e4189df5553832fe7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10888,
"upload_time": "2018-12-10T17:33:46",
"url": "https://files.pythonhosted.org/packages/41/3d/1158765b61ecbfedeff45b742df1f4865aaab0bb7c6c6d55213f920c843a/pytglue-1.0.1.tar.gz"
}
],
"1.0.2": [
{
"comment_text": "",
"digests": {
"md5": "52c0fac76d1567ef12d2b9bff018279d",
"sha256": "0fdce15249b89bd80b6db6279efa56cf7d71b1a57798febcfd1673dfe73fc9ea"
},
"downloads": -1,
"filename": "pytglue-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52c0fac76d1567ef12d2b9bff018279d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 22911,
"upload_time": "2018-12-12T16:07:34",
"url": "https://files.pythonhosted.org/packages/1f/12/f3c39200466359d79ec98023a65907090be81875ef5baa8de3fedbc9efdc/pytglue-1.0.2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "49d9620bcd2084f35b739b97500537db",
"sha256": "017285df6b5299d07588995536db0ff231164a2ec2cdafaac503218dc9f7e941"
},
"downloads": -1,
"filename": "pytglue-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "49d9620bcd2084f35b739b97500537db",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10899,
"upload_time": "2018-12-12T16:07:36",
"url": "https://files.pythonhosted.org/packages/41/85/ef1e840121721da8a76a99394f2b27711cac5cdbbbe070432cd309bc52d3/pytglue-1.0.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "52c0fac76d1567ef12d2b9bff018279d",
"sha256": "0fdce15249b89bd80b6db6279efa56cf7d71b1a57798febcfd1673dfe73fc9ea"
},
"downloads": -1,
"filename": "pytglue-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52c0fac76d1567ef12d2b9bff018279d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 22911,
"upload_time": "2018-12-12T16:07:34",
"url": "https://files.pythonhosted.org/packages/1f/12/f3c39200466359d79ec98023a65907090be81875ef5baa8de3fedbc9efdc/pytglue-1.0.2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "49d9620bcd2084f35b739b97500537db",
"sha256": "017285df6b5299d07588995536db0ff231164a2ec2cdafaac503218dc9f7e941"
},
"downloads": -1,
"filename": "pytglue-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "49d9620bcd2084f35b739b97500537db",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10899,
"upload_time": "2018-12-12T16:07:36",
"url": "https://files.pythonhosted.org/packages/41/85/ef1e840121721da8a76a99394f2b27711cac5cdbbbe070432cd309bc52d3/pytglue-1.0.2.tar.gz"
}
]
}