Apache Airflow Go OpenAPI Client

Go Airflow OpenAPI client generated from openapi spec.

Install

go get github.com/apache/airflow-client-go/airflow@latest

Usage

package main

import (
    "context"
    "fmt"
    "github.com/apache/airflow-client-go/airflow"
)

func main() {
    conf := airflow.NewConfiguration()
    conf.Host = "localhost:8080"
    conf.Scheme = "http"
    cli := airflow.NewAPIClient(conf)

    cred := airflow.BasicAuth{
        UserName: "username",
        Password: "password",
    }
    ctx := context.WithValue(context.Background(), airflow.ContextBasicAuth, cred)

    variable, _, err := cli.VariableApi.GetVariable(ctx, "foo").Execute()
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(variable)
    }
}

See README for full client API documentation.


Download Details:

Author: apache

Official Github:  https://github.com/apache/airflow-client-go 

License: Apache-2.0 license

#apache  #data   #data-analysis #data-science 

Apache Airflow Go OpenAPI Client
1.15 GEEK