{"id":20661965,"url":"https://github.com/mirantis/ifmap-python-client","last_synced_at":"2025-10-09T04:42:05.889Z","repository":{"id":140968156,"uuid":"79810109","full_name":"Mirantis/ifmap-python-client","owner":"Mirantis","description":null,"archived":false,"fork":false,"pushed_at":"2020-02-26T12:08:17.000Z","size":51,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-17T12:17:48.335Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mirantis.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-23T14:10:40.000Z","updated_at":"2019-07-18T14:59:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"a08a4683-1de2-4fd2-9e2c-a407015d0b02","html_url":"https://github.com/Mirantis/ifmap-python-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirantis%2Fifmap-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirantis%2Fifmap-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirantis%2Fifmap-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mirantis%2Fifmap-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mirantis","download_url":"https://codeload.github.com/Mirantis/ifmap-python-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242793058,"owners_count":20185949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T19:12:25.145Z","updated_at":"2025-10-09T04:42:00.848Z","avatar_url":"https://github.com/Mirantis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Copyright 2011, Infoblox, Inc. All Rights Reserved\n\nReleased under BSD, see LICENSE\n\nIF-MAP Python Client Library\n============================\n\nThis is a Python library for building IF-MAP clients.\n\nIt supports the Trusted Computing Group IF-MAP protocol v.2.0\nThere is no support for IF-MAP 1.0 or 1.1 and there are no plans to support those versions.\n\nCurrently Implemented:\n\n* Session: newSession, endSession, renewSession\n* Publish: Update, Notify, Delete\n* Identities: IP, MAC, Device, Access Request, Identity, Custom Identifier\n* Metadata: IF-MAP metadata and custom namespace metadata\n* Search: Search on all of the above IDs\n* Subscribe: SubscribeUpdate, SubscribeDelete\n* Purge: PurgeRequest\n* Poll: PollRequest\n\nTODO:\n* Implement XML schema validation (as optional)\n\n\n\nInstallation\n------------\n\nGet the python library from github:\n$ git clone git://github.com/IF-MAP/ifmap-python-client.git\n\nOr download as a zip file and unzip:\nhttps://github.com/IF-MAP/ifmap-python-client/zipball/master\n\n\nRequirements\n------------\n\nThe main library has no python requirements, except for ifmap.response (response.py) which uses xlm.etree to parse results.\nYou can implement the client entirely without response.py and parse your own responses in anyway you like.\nIf you do not use response.py, then you do not need any Python libraries. If you use it, you need xml.etree.\n\nLibrary Structure\n-----------------\n\n* ifmap - the directory containing the library components\n* testmap.py - a test script showing example code\n\nCode Example\n-------\nAn example of working code:\n\nfrom xml.etree import ElementTree # Only needed to parse results\n\nfrom ifmap.client import client, namespaces\nfrom ifmap.request import NewSessionRequest, RenewSessionRequest, EndSessionRequest, PublishRequest, SearchRequest\nfrom ifmap.id import IPAddress, MACAddress, Device, AccessRequest, Identity, CustomIdentity\nfrom ifmap.operations import PublishUpdateOperation, PublishNotifyOperation, PublishDeleteOperation\nfrom ifmap.util import attr, link_ids\nfrom ifmap.response import Response, newSessionResult\nfrom ifmap.metadata import Metadata\n\nmapclient = client(\"https://127.0.0.1:8443\", 'test', 'test', namespaces)\n\nresult = mapclient.call('newSession', NewSessionRequest())\nmapclient.set_session_id(newSessionResult(result).get_session_id())\nmapclient.set_publisher_id(newSessionResult(result).get_publisher_id())\n\nmeta = str(Metadata('role', 'employee', {'ifmap-cardinality':'multiValue'}))\npubreq = PublishRequest(mapclient.get_session_id(), str(PublishUpdateOperation(id1=str(IPAddress(\"10.0.0.1\")), metadata=meta, lifetime='forever')))\nresult = mapclient.call('publish', pubreq)\nprint Response(result)\n\nsearchreq = SearchRequest(mapclient.get_session_id(), str(IPAddress(\"10.0.0.1\")), validation=\"None\")\nresult = mapclient.call('search', searchreq)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirantis%2Fifmap-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmirantis%2Fifmap-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmirantis%2Fifmap-python-client/lists"}