{"id":13787296,"url":"https://github.com/robertcsapo/ciscodnacapphosting","last_synced_at":"2026-05-03T07:37:54.830Z","repository":{"id":52996069,"uuid":"310516300","full_name":"robertcsapo/ciscodnacapphosting","owner":"robertcsapo","description":"ciscodnacapphosting Python SDK for Cisco DNA Center Application Hosting API","archived":false,"fork":false,"pushed_at":"2021-04-10T15:14:39.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-14T11:29:11.279Z","etag":null,"topics":["api","catalyst-9k","cisco","cisco-dna-center","containers","docker","iox","python"],"latest_commit_sha":null,"homepage":"","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/robertcsapo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-06T06:54:08.000Z","updated_at":"2021-04-10T15:13:06.000Z","dependencies_parsed_at":"2022-09-08T00:13:06.301Z","dependency_job_id":null,"html_url":"https://github.com/robertcsapo/ciscodnacapphosting","commit_stats":null,"previous_names":["robertcsapo/cisco-dnac-app-hosting-import-docker-images"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/robertcsapo/ciscodnacapphosting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcsapo%2Fciscodnacapphosting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcsapo%2Fciscodnacapphosting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcsapo%2Fciscodnacapphosting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcsapo%2Fciscodnacapphosting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertcsapo","download_url":"https://codeload.github.com/robertcsapo/ciscodnacapphosting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertcsapo%2Fciscodnacapphosting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32562118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","catalyst-9k","cisco","cisco-dna-center","containers","docker","iox","python"],"created_at":"2024-08-03T20:00:32.542Z","updated_at":"2026-05-03T07:37:54.801Z","avatar_url":"https://github.com/robertcsapo.png","language":"Python","funding_links":[],"categories":["Automation"],"sub_categories":[],"readme":"# ciscodnacapphosting\n![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/robertcsapo/ciscodnacapphosting)\n![Docker Cloud Automated build](https://img.shields.io/docker/cloud/automated/robertcsapo/ciscodnacapphosting)\n![Docker Pulls](https://img.shields.io/docker/pulls/robertcsapo/ciscodnacapphosting)\n![Docker Image Version (latest by date)](https://img.shields.io/docker/v/robertcsapo/ciscodnacapphosting)  \n![PyPI - Downloads](https://img.shields.io/pypi/dm/ciscodnacapphosting)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/ciscodnacapphosting)\n![PyPI](https://img.shields.io/pypi/v/ciscodnacapphosting)\n\n\n\nDisclaimer  \nThis solution leverages currently unpublished Cisco DNA Center APIs (as of DATE)  \nDo not use in production\n\n```ciscodnacapphosting``` is a Python SDK for Cisco DNA Center Application Hosting API.  \nIt uses local docker environment to pull and save docker images.\n\n# Prerequisites\n- Cisco DNA Center\n  - Supported release: 2.1.2+\n- Cisco Catalyst 9000 Switches/APs\n- Python\n  - Version: 3.8+\n  \n# Import Docker images to Cisco DNA Center application hosting\n\nIf you develop your own container images, then you can use this tool to automatically upload or update those container to any Cisco DNA Center Application Hosting Repository (using the Platform API).\n\nIt's possible to use this tool together with your CI/CD by adding these steps  \n* ```pip install ciscodnacapphosting```  \n* ```ciscodnacapphosting upgrade --id 71257f4a-1f68-43a5-85f0-3347137107bb --tag 1.31 --file busybox-1.32.tar --categories IOT```\n\nCreating containers on your own workstation/development environment?  \nNo worries, just install this tool through ```pip``` and upload your container directly to Cisco DNA Center.\n\nThis code is also shared on Cisco DevNet Code Exchange - [cisco-dnac-app-hosting-import-docker-images](https://developer.cisco.com/codeexchange/github/repo/robertcsapo/cisco-dnac-app-hosting-import-docker-images)\n\n## Application Hosting\n[Application Hosting on Catalyst 9000 series switches](https://developer.cisco.com/app-hosting/)\n\n## Related Sandbox\n[IOS XE on Catalyst 9000 16.12 Code](https://devnetsandbox.cisco.com/RM/Diagram/Index/98d5a0fb-1b92-4b5b-abf6-a91e0ddba241?diagramType=Topology)\n\n## Links to DevNet Learning Labs\n[Application Hosting on IOS XE Learning Lab](https://developer.cisco.com/learning/modules/app-hosting-cat9k)\n\n# Demo\n```bash\nciscodnacapphosting app --image busybox\nGet App (busybox)\ndata:\n- _links:\n    configuration:\n      href: /api/v1/appmgr/apps/71257f4a-1f68-43a5-85f0-3347137107bb/1.32/config\n    icon:\n      href: null\n    images:\n      href: /api/v1/appmgr/apps/71257f4a-1f68-43a5-85f0-3347137107bb/1.32/images\n    packages:\n      href: /api/v1/appmgr/apps/71257f4a-1f68-43a5-85f0-3347137107bb/1.32/packages\n    self:\n      href: /api/v1/appmgr/apps/71257f4a-1f68-43a5-85f0-3347137107bb/1.32\n  appId: 71257f4a-1f68-43a5-85f0-3347137107bb\n  appType: docker\n  categories:\n  - IOT\n  classification: APP\n  cpuUsage: 0\n  description:\n    contentType: text\n  descriptor:\n    app:\n      cpuarch: x86_64\n      env:\n        PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n      resources:\n        network:\n        - interface-name: eth0\n          ports: {}\n        profile: c1.large\n      startup:\n        rootfs: fogd_upload_8699102144278681062.tar\n        target:\n        - sh\n      type: docker\n    descriptor-schema-version: '2.2'\n    info:\n      name: busybox\n      version: '1.32'\n  icon:\n    caption: icon\n    href: null\n  images: []\n  lastUpdatedDate: 1604930943165\n  localAppId: 71257f4a-1f68-43a5-85f0-3347137107bb\n  memoryUsage: 0\n  name: busybox\n  packages:\n  - href: /api/v1/appmgr/apps/71257f4a-1f68-43a5-85f0-3347137107bb/1.32/packages/b55be543-b969-415b-b47d-da95df834a5f\n  profileNeeded: c1.large\n  properties: []\n  published: true\n  releaseNotes:\n    contentType: text\n  services: []\n  signed: false\n  version: '1.32'\n```\n```bash\nciscodnacapphosting docker --download alpine:3.12.0 --save\nDownload completed (alpine) - saved as alpine-3.12.0.tar\n```\n```bash\nciscodnacapphosting upload --file alpine-3.12.0.tar --categories IOT\nUpload App (alpine-3.12.0.tar) - IOT\nNew AppId (1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f) alpine:3.12.0 - IOT\n```\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install ```ciscodnacapphosting```.\n\n```bash\npip install ciscodnacapphosting\n```\n\n## Usage\n\nConfiguration can be stored in config.json in JSON format.\n```\n{\n    \"dnac\": {\n        \"hostname\": \"dnac.example.tld\",\n        \"username\": \"superadmin\",\n        \"password\": \"superpassword\",\n        \"secure\": true\n    }\n}\n```\n_(secure parameter is for HTTPS verification)_\n\nThe configuration can be encoded as base64 string.\n```ewogICAgImRuYWMiOiB7CiAgICAgICAgImhvc3RuYW1lIjogImRuYWMuZXhhbXBsZS50bGQiLAogICAgICAgICJ1c2VybmFtZSI6ICJzdXBlcmFkbWluIiwKICAgICAgICAicGFzc3dvcmQiOiAic3VwZXJwYXNzd29yZCIsCiAgICAgICAgInNlY3VyZSI6IHRydWUKICAgIH0KfQ==```\n\nIf using base64 encoded, then it's possible to set Environment ```DNAC_CONFIG```\n```bash\nexport DNAC_CONFIG=ewogICAgImRuYWMiOiB7CiAgICAgICAgImhvc3RuYW1lIjogImRuYWMuZXhhbXBsZS50bGQiLAogICAgICAgICJ1c2VybmFtZSI6ICJzdXBlcmFkbWluIiwKICAgICAgICAicGFzc3dvcmQiOiAic3VwZXJwYXNzd29yZCIsCiAgICAgICAgInNlY3VyZSI6IHRydWUKICAgIH0KfQ==\n```\n\n### CLI\n\n```bash\nciscodnacapphosting config --hostname dnac.example.tld --username superadmin --password superpassword --secure --encode\n\nciscodnacapphosting app\nciscodnacapphosting app--image busybox\n\nciscodnacapphosting docker\nciscodnacapphosting docker --download busybox:1.31 --save\n\nciscodnacapphosting upload --file busybox-1.31.tar --categories IOT\n\nciscodnacapphosting upgrade --id 71257f4a-1f68-43a5-85f0-3347137107bb --tag 1.31 --file busybox-1.32.tar --categories IOT\n\nciscodnacapphosting update --id 71257f4a-1f68-43a5-85f0-3347137107bb --categories Security\n\nciscodnacapphosting delete --id 71257f4a-1f68-43a5-85f0-3347137107bb --tag 1.31\n```\n\n#### Help\n```bash\nciscodnacapphosting --help\nUsage: ciscodnacapphosting [OPTIONS] COMMAND1 [ARGS]... [COMMAND2\n                           [ARGS]...]...\n\nOptions:\n  --version  Show the version and exit.\n  --help     Show this message and exit.\n\nCommands:\n  app\n  config\n  delete\n  docker\n  update\n  upgrade\n  upload\n  whoami\n  ```\n\n### Include in Python\n\n```python\nimport ciscodnacapphosting\n\ndnac_app = ciscodnacapphosting.Api()\ndownload = dnac_app.docker.download(image=\"busybox\", tag=\"1.31\")\nsave = dnac_app.docker.save(image=download[\"image\"], tag=download[\"tag\"])\nupload = dnac_app.upload(tar=save[\"filename\"], categories=\"IOT\")\nupgrade = dnac_app.upgrade(\n        appId=appId, tag=tag, tar=\"busybox-1.32.tar\", categories=\"IOT\"\n    )\nupdate = dnac_app.update(\n        appId=\"46e54562-83c9-4183-8632-c597c8cc5a2b\", categories=\"IOT\"\n    )\ndelete = dnac_app.delete(appId=appId, tag=tag)\n```\n_(More examples in [examples/](./examples) folder)_\n\n### Docker\n```docker\ndocker run -it --rm --privileged -e DNAC_CONFIG=ewogICAgImRuYWMiOiB7CiAgICAgICAgImhvc3RuYW1lIjogImRuYWMuZXhhbXBsZS50bGQiLAogICAgICAgICJ1c2VybmFtZSI6ICJzdXBlcmFkbWluIiwKICAgICAgICAicGFzc3dvcmQiOiAic3VwZXJwYXNzd29yZCIsCiAgICAgICAgInNlY3VyZSI6IHRydWUKICAgIH0KfQ== robertcsapo/ciscodnacapphosting\n```\n```bash\n/ # ciscodnacapphosting whoami\nConfig: {\"dnac\": {\"hostname\": \"dnac.example.tld\", \"username\": \"superadmin\", \"password\": \"superpassword\", \"secure\": true}}\n/ # \n```\n```bash\n/ # ciscodnacapphosting app --image alpine\nGet App (alpine)\ndata:\n- _links:\n    configuration:\n      href: /api/v1/appmgr/apps/1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f/3.12.0/config\n    icon:\n      href: null\n    images:\n      href: /api/v1/appmgr/apps/1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f/3.12.0/images\n    packages:\n      href: /api/v1/appmgr/apps/1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f/3.12.0/packages\n    self:\n      href: /api/v1/appmgr/apps/1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f/3.12.0\n  appId: 1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f\n  appType: docker\n  categories:\n  - IOT\n  classification: APP\n  cpuUsage: 0\n  creationDate: 1604950418368\n  description:\n    contentType: text\n  descriptor:\n    app:\n      cpuarch: x86_64\n      env:\n        PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n      resources:\n        network:\n        - interface-name: eth0\n          ports: {}\n        profile: c1.large\n      startup:\n        rootfs: fogd_upload_7626901429300115262.tar\n        target:\n        - /bin/sh\n      type: docker\n    descriptor-schema-version: '2.2'\n    info:\n      name: alpine\n      version: 3.12.0\n  icon:\n    caption: icon\n    href: null\n  images: []\n  localAppId: 1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f\n  memoryUsage: 0\n  name: alpine\n  packages:\n  - href: /api/v1/appmgr/apps/1a12b3d9-22d5-40ee-8aff-e2ccfb79c59f/3.12.0/packages/10d8de54-9c21-4f65-bda1-540ef5e4e1ac\n  profileNeeded: c1.large\n  properties: []\n  published: true\n  releaseNotes:\n    contentType: text\n  services: []\n  signed: false\n  version: 3.12.0\n```\n\n## Technologies \u0026 Frameworks Used\n\n**Cisco Products \u0026 Services:**\n\n- [Cisco DNA Center Platform API](https://developer.cisco.com/dnacenter/)\n- [Docker](https://www.docker.com/get-started)\n    - [dockerpy](https://github.com/docker/docker-py/)\n\n## Authors \u0026 Maintainers\n\n- Robert Csapo \u003crcsapo@cisco.com\u003e\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed to you under the terms of the [Cisco Sample\nCode License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertcsapo%2Fciscodnacapphosting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertcsapo%2Fciscodnacapphosting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertcsapo%2Fciscodnacapphosting/lists"}