A Go library for interacting with the Cisco Smart Bonding API.
Currently a work in progress. This README will get updated as it progresses.
Import the library
import "github.com/darrenparkinson/ciscosmartbonding"
Initialise a client:
c := ciscosmartbonding.NewClient(clientID, secret, nil)
You can optionally provide your own Resty v2 client.
Retrieve TSP Codes with the client
res, err := c.GetAllTSPCodes(context.Background())
There are various examples to perform the various steps required. They all rely on having the
appropriate environment variables which can be within a .env
file at the top level of the repository.
Firstly, there is the retriever
example. This will perform the pull update requests every 30 seconds
and display summary information.
This should be opened in a separate window whilst you run the other samples:
$ go run ./examples/0-retriever-service -env development
Refer to the README for more information.
This can be used to create a new shadow ticket. You will need a lot more variables for this example.
Refer to the README for more information.
$ go run ./examples/2-create-ticket
There is a variation on this to create an an escalated P1 ticket:
$ go run ./examples/9-create-ticket-escalated-p1
You should update the details to use a new ticket number each time.
This demonstrates the use of a helper function and the equivalent PushUpdate function for updating work notes in a ticket.
This provides an example of retrieving the TSP codes. It will output the total number of TSP codes available and save them to a CSV. Optionaly you can specify to save as json.
$ go run ./examples/1-tsp
Retrieved 19078 codes
An example of pulling down updates. This is similar to the retriever example, but performs a single pull.