Apache Airflow - OpenApi Client for Go

Clone this repo:

Branches

  1. c4bfdb8 upgrade go client to latest api spec using openapi-generator 5.x (#10) by QP Hou · 6 weeks ago master
  2. 275741a Prepare for rename default branch to main (#8) by Ash Berlin-Taylor · 4 months ago main
  3. b3eb67a Make sample code self-contained & fix errors inside (#7) by Xiaodong DENG · 4 months ago
  4. 424e074 enable issue tracking for the repo (#6) by QP Hou · 4 months ago
  5. e1deffd add test & doc for authentication (#5) by QP Hou · 11 months ago

Airflow Go client

Go Airflow OpenAPI client generated from openapi spec.

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.

Release process

Go client is versioned using semantic import versioning.

To release a new version 1.x.y, simply push a new tag to this repo named airflow/v1.x.y.

Major version upgrade requires changing package import path based on semantic import versioning, which needs to be done manually.