@@ -0,0 +1,2355 @@
+/*%0ACopyright 2018 The Kubernetes Authors.%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A    http://www.apache.org/licenses/LICENSE-2.0%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A*/%0Apackage io.kubernetes.client.examples;%0A%0Aimport io.kubernetes.client.ApiException;%0Aimport io.kubernetes.client.custom.IntOrString;%0Aimport io.kubernetes.client.models.V1Pod;%0Aimport io.kubernetes.client.models.V1PodBuilder;%0Aimport io.kubernetes.client.models.V1Service;%0Aimport io.kubernetes.client.models.V1ServiceBuilder;%0Aimport io.kubernetes.client.util.Yaml;%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0A%0A/**%0A * A simple example of how to parse a Kubernetes object.%0A *%0A * %3Cp%3EEasiest way to run this: mvn exec:java%0A * -Dexec.mainClass=%22io.kubernetes.client.examples.YamlExample%22%0A *%0A * %3Cp%3EFrom inside $REPO_DIR/examples%0A */%0Apublic class YamlExample %7B%0A  public static void main(String%5B%5D args) throws IOException, ApiException, ClassNotFoundException %7B%0A    V1Pod pod =%0A        new V1PodBuilder()%0A            .withNewMetadata()%0A            .withName(%22apod%22)%0A            .endMetadata()%0A            .withNewSpec()%0A            .addNewContainer()%0A            .withName(%22www%22)%0A            .withImage(%22nginx%22)%0A            .withNewResources()%0A            .withLimits(new HashMap%3C%3E())%0A            .endResources()%0A            .endContainer()%0A            .endSpec()%0A            .build();%0A    System.out.println(Yaml.dump(pod));%0A%0A    V1Service svc =%0A        new V1ServiceBuilder()%0A            .withNewMetadata()%0A            .withName(%22aservice%22)%0A            .endMetadata()%0A            .withNewSpec()%0A            .withSessionAffinity(%22ClientIP%22)%0A            .withType(%22NodePort%22)%0A            .addNewPort()%0A            .withProtocol(%22TCP%22)%0A            .withName(%22client%22)%0A            .withPort(8008)%0A            .withNodePort(8080)%0A            .withTargetPort(new IntOrString(8080))%0A            .endPort()%0A            .endSpec()%0A            .build();%0A    System.out.println(Yaml.dump(svc));%0A  %7D%0A%7D%0A

Add an example of using YAML