Search in sources :

Example 1 with ApiextensionsV1Api

use of com.marcnuri.yakc.api.apiextensions.v1.ApiextensionsV1Api in project yakc by manusa.

the class CrdQuickstart method main.

public static void main(String[] args) {
    System.out.println("Complete Custom Resource Definition (CRD) example:\n" + " - Creates a namespace\n" + " - Deletes CRD if exists\n" + " - Creates CRD\n" + " - Creates custom resource - TV Show\n" + " - List entries for custom resource - TV Show\n" + " - Patch entry for custom resource - TV Show\n" + " - List patched entries for custom resource - TV Show\n" + "Starting...\n");
    try (KubernetesClient kc = new KubernetesClient()) {
        final CoreV1Api core = kc.create(CoreV1Api.class);
        final ApiextensionsV1Api extensions = kc.create(ApiextensionsV1Api.class);
        final ShowsV1Api shows = kc.create(ShowsV1Api.class);
        createNamespace(core);
        deleteCrdIfExists(extensions);
        createCrd(extensions);
        createShows(shows);
        listShows(shows);
        patchShow(shows);
        listShows(shows);
        deleteCrd(extensions);
    } catch (IOException ex) {
        ex.printStackTrace();
    }
}
Also used : ApiextensionsV1Api(com.marcnuri.yakc.api.apiextensions.v1.ApiextensionsV1Api) KubernetesClient(com.marcnuri.yakc.KubernetesClient) IOException(java.io.IOException) CoreV1Api(com.marcnuri.yakc.api.core.v1.CoreV1Api)

Aggregations

KubernetesClient (com.marcnuri.yakc.KubernetesClient)1 ApiextensionsV1Api (com.marcnuri.yakc.api.apiextensions.v1.ApiextensionsV1Api)1 CoreV1Api (com.marcnuri.yakc.api.core.v1.CoreV1Api)1 IOException (java.io.IOException)1