w0de / go-jamf-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jamf API in Go

Mostly implemented Golang library for the Jamf Pro API.

The Classic API support is written manually, UAPI support is written programmatically using the OpenAPI Generator based upon the publicly available swagger docs.

Classic API Usage

Example Code

package main

import (
	"fmt"
	"time"
    "log"

	"github.com/yohan460/go-jamf-api"
)

func main() {
	url := "https://example.jamfcloud.com"
	client, err := jamf.NewClient(
        url,
        jamf.WithOAuth("client-id", "client-secret"),
    )
	if err != nil {
		log.Fatal(err)
	}

	// Use the client to make requests to the Jamf API
}

UAPI Usage

See Usage docs

UAPI Regeneration

When there is a Jamf UAPI schema upgrade the generate-api.sh file can be run with the new swagger schema as the first parameter to re-generate it

The script contains a couple of patches to ensure it is syntactically correct go code.

About

License:Other


Languages

Language:Go 98.2%Language:Shell 1.7%Language:Makefile 0.1%