apache / openwhisk-client-go

Go client library for the Apache OpenWhisk platform
https://openwhisk.apache.org/
Apache License 2.0
35 stars 44 forks source link

Adds support for activation count #155

Closed ddebarros closed 1 year ago

ddebarros commented 1 year ago

This PR adds a new method for getting and filtering the total number of activations.

Usage

func main() {
    client, err := whisk.NewClient(http.DefaultClient, nil)
    if err != nil {
        fmt.Println(err)
        os.Exit(-1)
    }

    options := &whisk.ActivationCountOptions{
        Name:  "sample/hello",
        Since: 1665662104000,
    }

    count, resp, err := client.Activations.Count(options)
    if err != nil {
        fmt.Println(err)
        os.Exit(-1)
    }

    fmt.Println("Returned with status: ", resp.Status)
    fmt.Printf("Returned actions: \n %+v", count)

}
rabbah commented 1 year ago

Thank you @ddebarros for your first contribution to the project 🎉