Skip to content

sapcc/go-awx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWX Go Client

This is a Go client for interacting with the AWX API. AWX is an open-source project that provides a web-based user interface, REST API, and task engine built on top of Ansible.

Installation

To install the AWX Go client, use go get:

go get github.com/sapcc/go-awx

Usage

Here is a basic example of how to use the AWX Go client:

package main

import (
    "fmt"
    "log"
    awx "github.com/sapcc/go-awx"
)

func main() {
    client, err := awx.NewClient(awx.Options{
        Endpoint: "https://your-awx.cloud/api/v2",
        Username: "username",
		Password: "password",
		Token:    "token",
    })
    if err != nil {
        log.Fatalf("Failed to create AWX client: %v", err)
    }
    input := ListJobsInput{ID: "1"}
	jobs := JobList{}
    err = client.List(context.Background(), awx.ObjectKey{Resource: "jobs"}, &jobs, nil)
    if err != nil {
        log.Fatalf("Failed to list inventories: %v", err)
    }

    for _, job := range jobs.Results {
        fmt.Printf("job: %s\n", job.Name)
    }
}

Features

  • List inventories
  • Create, update, and delete inventories
  • List job templates
  • Launch job templates
  • And more...

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages