From f6433ca252cd91cd62fad533a5f94dc92736a7f3 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Mon, 12 Jun 2017 22:54:30 -0700 Subject: [PATCH] Add some example code. --- examples/simple/PodList.cs | 21 +++++++++++++++++++++ examples/simple/simple.csproj | 14 ++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 examples/simple/PodList.cs create mode 100755 examples/simple/simple.csproj diff --git a/examples/simple/PodList.cs b/examples/simple/PodList.cs new file mode 100755 index 0000000..9fa43a0 --- /dev/null +++ b/examples/simple/PodList.cs @@ -0,0 +1,21 @@ +using System; + +using k8s; + +namespace simple +{ + class PodList + { + static void Main(string[] args) + { + IKubernetes client = new Kubernetes(); + client.BaseUri = new Uri("http://localhost:8001"); + var listTask = client.ListNamespacedPodWithHttpMessagesAsync("default"); + listTask.Wait(); + var list = listTask.Result.Body; + foreach (var item in list.Items) { + Console.WriteLine(item.Metadata.Name); + } + } + } +} diff --git a/examples/simple/simple.csproj b/examples/simple/simple.csproj new file mode 100755 index 0000000..e16c63b --- /dev/null +++ b/examples/simple/simple.csproj @@ -0,0 +1,14 @@ + + + + + + + + + + Exe + netcoreapp1.1 + + +