Skip to content

Instantly share code, notes, and snippets.

@yifan-gu
Created April 28, 2016 18:56
Show Gist options
  • Save yifan-gu/6361fa62bd51ce46f0b6d067cdd25c28 to your computer and use it in GitHub Desktop.
Save yifan-gu/6361fa62bd51ce46f0b6d067cdd25c28 to your computer and use it in GitHub Desktop.
rkt_api_list.go
package main
import (
"fmt"
"os"
"github.com/coreos/rkt/api/v1alpha"
"golang.org/x/net/context"
"google.golang.org/grpc"
)
func main() {
conn, err := grpc.Dial("localhost:15441", grpc.WithInsecure())
if err != nil {
fmt.Println(err)
os.Exit(1)
}
c := v1alpha.NewPublicAPIClient(conn)
defer conn.Close()
// List pods.
podResp, err := c.ListPods(context.Background(), &v1alpha.ListPodsRequest{Detail: true})
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(podResp)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment