{"id":47354149,"url":"https://github.com/cisco-pxgrid/cloud-sdk-go","last_synced_at":"2026-03-18T01:28:35.106Z","repository":{"id":42155395,"uuid":"477829347","full_name":"cisco-pxgrid/cloud-sdk-go","owner":"cisco-pxgrid","description":"Cisco pxGrid Cloud SDK for the Go programming language","archived":false,"fork":false,"pushed_at":"2025-06-25T19:08:50.000Z","size":773,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-25T20:23:07.308Z","etag":null,"topics":["cisco","go","golang","pxgrid","sdk"],"latest_commit_sha":null,"homepage":"https://developer.cisco.com/pxgrid-cloud","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cisco-pxgrid.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null}},"created_at":"2022-04-04T18:41:02.000Z","updated_at":"2025-06-25T15:20:11.000Z","dependencies_parsed_at":"2024-06-13T03:56:23.890Z","dependency_job_id":"bfd5636a-680a-43ec-bc5b-453bc96ff788","html_url":"https://github.com/cisco-pxgrid/cloud-sdk-go","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/cisco-pxgrid/cloud-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-pxgrid%2Fcloud-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-pxgrid%2Fcloud-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-pxgrid%2Fcloud-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-pxgrid%2Fcloud-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cisco-pxgrid","download_url":"https://codeload.github.com/cisco-pxgrid/cloud-sdk-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cisco-pxgrid%2Fcloud-sdk-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30639878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-18T00:09:27.587Z","status":"ssl_error","status_checked_at":"2026-03-18T00:09:26.123Z","response_time":56,"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":["cisco","go","golang","pxgrid","sdk"],"created_at":"2026-03-18T01:28:34.488Z","updated_at":"2026-03-18T01:28:35.098Z","avatar_url":"https://github.com/cisco-pxgrid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cisco pxGrid Cloud SDK for Go\n\n![Tests](https://github.com/cisco-pxgrid/cloud-sdk-go/actions/workflows/test.yaml/badge.svg?branch=main) ![Static Analysis](https://github.com/cisco-pxgrid/cloud-sdk-go/actions/workflows/lint.yaml/badge.svg?branch=main) [![Release](https://img.shields.io/github/v/release/cisco-pxgrid/cloud-sdk-go?sort=semver)](https://github.com/cisco-pxgrid/cloud-sdk-go/releases/latest) [![Docs](https://pkg.go.dev/badge/github.com/cisco-pxgrid/cloud-sdk-go)](https://pkg.go.dev/github.com/cisco-pxgrid/cloud-sdk-go)\n\n# Overview\n\n`cloud-sdk-go` is the Cisco pxGrid Cloud SDK for the Go programming language.\n\nThe SDK lets you easily create applications for Cisco pxGrid Cloud and consume pxGrid, ERS and\nOpenAPI services from Cisco Identity Services Engine (ISE) devices.\n\n## Features\n\n- Multi-tenancy support\n- Create an instance of an application\n- Link application with a Cisco DNA - Cloud tenant\n- Receive pxGrid topic messages from Cisco ISE devices\n- Invoke HTTP APIs on Cisco ISE devices\n    + pxGrid APIs\n    + ERS APIs\n    + OpenAPI APIs\n\n## For other languagues\nCurrently, there is only SDK for Go.\nFor integration with other languages, the HTTP APIs and WebSocket are described here:\n- https://www.postman.com/alei121/cisco-pxgrid-cloud/overview\n\n# Install\n\n```sh\ngo get github.com/cisco-pxgrid/cloud-sdk-go\n```\n\n# Usage\n\n## Examples\n\n### Create a new app instance\n\n```go\nimport (\n    \"fmt\"\n    sdk \"github.com/cisco-pxgrid/cloud-sdk-go\"\n)\n\n// activationHandler is invoked when the app gets activated for a new device for a tenant\nfunc activationHandler(device *sdk.Device) {\n    fmt.Printf(\"New device activated: %s\\n\", device)\n}\n\n// deactivationHandler is invoked when the app gets deactivated for an existing device for a tenant\nfunc deactivationHandler(device *sdk.Device) {\n    fmt.Printf(\"Device deactivated: %s\\n\", device)\n}\n\n// messageHandler is invoked when there's a new message received by the app for a device\nfunc messageHandler(id string, device *sdk.Device, stream string, payload []byte) {\n\tfmt.Printf(\"Device message: %s, %s\\n\", stream, string(p))\n}\n\n// getCredentials is invoked whenever the app needs to retrieve the app credentials\nfunc getCredentials() (*sdk.Credentials, error) {\n    return \u0026sdk.Credentials{\n        ApiKey: []byte(\"api-key-obtained-during-app-onboarding\"),\n    }, nil\n}\n\nfunc main() {\n    // create app configuration required for creating a new app instance\n    config := sdk.Config{\n        ID:                        \"pxgrid-cloud-sample-app\",\n        GetCredentials:            getCredentials,\n        RegionalFQDN:              \"regional.cloud.cisco.com\",\n        GlobalFQDN:                \"global.cloud.cisco.com\",\n        DeviceActivationHandler:   activationHandler,\n        DeviceDeactivationHandler: deactivationHandler,\n        DeviceMessageHandler:      messageHandler,\n        ReadStreamID:              \"app--pxgrid-cloud-sample-app-R\",\n        WriteStreamID:             \"app--pxgrid-cloud-sample-app-W\",\n    }\n\n   \tapp, err := sdk.New(config)\n    if err != nil {\n        fmt.Printf(\"Failed to create new app: %v\", err)\n        os.Exit(1)\n    }\n    // make sure to Close() the app instance to release resources acquired during app creation\n    defer func() {\n        if err := app.Close(); err != nil {\n            fmt.Printf(\"Disconnected with error: %v\", err)\n        }\n    }()\n\n    // wait for any errors from the app instance created above\n    err = \u003c- app.Error\n    if err != nil {\n        fmt.Printf(\"%s received an error: %v\", app, err)\n    }\n}\n```\n\n### Link and unlink with a tenant\n\n```go\ntenant, err := app.LinkTenant(\"otp-obtained-from-cisco-dna-portal\")\n\n// Securely store tenant.ID(), tenant.Name() and tenant.ApiToken()\n\nerr = app.UnlinkTenant(tenant)\n```\n\n\n### Setup already linked tenants\n\nIf the app needs to be restarted, use the stored tenant info to re-link.\n\n```go\ntenant, err := app.SetTenant(\"tenant-id\", \"tenant-name\", \"tenant-api-token\")\n```\n\n### Create and delete multi-instance app instances\n\nIf the app is registered as multi-instance, create and delete app instances can be used.\n\n```go\n// With the parent app object, create an app instance\nappInstance, err = app.CreateAppInstance(ac.Name)\n// Securely store appInstance.ID(), appInstance.ApiKey()\n\n// appInstance can then be used to link multiple tenants\ntenant, err = appInstance.LinkTenant(\"otp-obtained-from-cisco-dna-portal\")\n\n// Prior to deleting app instance,\n// ensure all ISE are deactivated from the app instance.\n// After deactivating all ISE devices, tenants can be unlinked.\nappInstance.UnlinkTenant(tenant)\n// When all are unlinked, delete app instance with parent app.\napp.DeleteAppInstance(appInstance.ID())\n```\n\n\n### Invoke an ERS or OpenAPI HTTP API call on a device\n\nERS and OpenAPI URLs start with \"/ers\" and \"/api\" respectively.\n\n[API guide and reference](https://developer.cisco.com/docs/identity-services-engine/latest/#!cisco-ise-api-framework)\n\n```go\nreq, _ := http.NewRequest(http.MethodGet, \"/ers/config/op/systemconfig/iseversion\", nil)\nresp, err := device.Query(req)\n```\n\n### Invoke pxGrid HTTP API on a device\n\npxGrid API URLs start with \"/pxgrid\".\n\n[pxGrid Reference](https://github.com/cisco-pxgrid/pxgrid-rest-ws/wiki)\n\nIn order to invoke pxGrid APIs directly on the device, ServiceLookup is not required.\nInstead map the service name to the keyword and append it to the URL along with pxgrid\n\n| pxGrid Service                   | pxGrid Cloud Service |\n|----------------------------------|----------------------|\n| com.cisco.ise.session            | session              |\n| com.cisco.ise.config.anc         | anc                  |\n| com.cisco.ise.mdm                | mdm                  |\n| com.cisco.ise.config.profiler    | profiler             |\n| com.cisco.ise.radius             | radius               |\n| com.cisco.ise.trustsec           | trustsec             |\n| com.cisco.ise.config.trustsec    | trustsec             |\n| com.cisco.ise.sxp                | trustsec             |\n| com.cisco.ise.echo               | echo                 |\n| com.cisco.ise.endpoint           | endpoint             |\n\n\n```go\n\n// getSecurityGroups is an API from com.cisco.cise.config.trustsec service, so trustsec is used in the URL\nreq, _ := http.NewRequest(http.MethodPost, \"/pxgrid/trustsec/getSecurityGroups\", strings.NewReader(\"{}\"))\nresp, err := device.Query(req)\n```\n\n### Query limitation\nThere is a limitation on both request and response body size\n\n| Size  | From ISE versions |\n|-------|-------------------|\n| 500KB | 3.1p3, 3.2        |\n| 50MB  | 3.2p2, 3.3        |\n| 2GB   | 3.2p3, 3.3p1, 3.4 |\n\n\n### Stream names mappings\n\nThese are the mappings of pxGrid Cloud stream names from pxGrid topic\n\n| pxGrid Service                   | pxGrid property name  | pxGrid Cloud stream name            |\n|----------------------------------|-----------------------|-------------------------------------|\n| com.cisco.ise.session            | sessionTopic          | pxcloud--session-sessions           |\n| com.cisco.ise.session            | groupTopic            | pxcloud--session-userGroups         |\n| com.cisco.ise.config.anc         | statusTopic           | pxcloud--anc-operationStatus        |\n| com.cisco.ise.mdm                | endpointTopic         | pxcloud--mdm-endpoints              |\n| com.cisco.ise.config.profiler    | topic                 | pxcloud--profiler-profiles          |\n| com.cisco.ise.radius             | failureTopic          | pxcloud--radius-failures            |\n| com.cisco.ise.trustsec           | policyDownloadTopic   | pxcloud--trustsec-policyDownloads   |\n| com.cisco.ise.config.trustsec    | securityGroupTopic    | pxcloud--trustsec-securityGroups    |\n| com.cisco.ise.config.trustsec    | securityGroupAclTopic | pxcloud--trustsec-securityGroupAcls |\n| com.cisco.ise.sxp                | bindingTopic          | pxcloud--trustsec-bindings          |\n| com.cisco.ise.echo               | echoTopic             | pxcloud--echo-echo                  |\n| com.cisco.ise.endpoint           | topic                 | pxcloud--endpoint-endpoints         |\n\n\n## Terminology\n\n- `App`: An app represents an application that's available on the Cisco DNA - Cloud App Store.\n- `Tenant`: A tenant represents a Cisco customer that subscribes to and intends to use services\nCisco DNA - Cloud services.\n- `Device`: A device represents an on-premise entity (an appliance, a VM, a deployment, a cluster,\n  etc.) that is registered with the Cisco DNA - Cloud. Cisco ISE is such an example.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-pxgrid%2Fcloud-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcisco-pxgrid%2Fcloud-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcisco-pxgrid%2Fcloud-sdk-go/lists"}