Files
csharp/examples/simple/PodList.cs

25 lines
725 B
C#
Raw Normal View History

2017-09-14 10:47:41 -07:00
namespace simple
2017-06-12 22:54:30 -07:00
{
using System;
using System.IO;
using k8s;
2017-06-12 22:54:30 -07:00
class PodList
{
static void Main(string[] args)
{
var k8sClientConfig = new KubernetesClientConfiguration();
IKubernetes client = new Kubernetes(k8sClientConfig);
Console.WriteLine("Starting Request!");
var listTask = client.ListNamespacedPodWithHttpMessagesAsync("default").Result;
var list = listTask.Body;
2017-06-12 22:54:30 -07:00
foreach (var item in list.Items) {
Console.WriteLine(item.Metadata.Name);
}
if (list.Items.Count == 0) {
Console.WriteLine("Empty!");
}
2017-06-12 22:54:30 -07:00
}
}
}