@@ -0,0 +1,2443 @@
+/**%0A * Copyright (C) 2015 Red Hat, Inc.%0A * %3Cp%3E%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A * %3Cp%3E%0A * http://www.apache.org/licenses/LICENSE-2.0%0A * %3Cp%3E%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage io.fabric8.kubernetes.examples;%0A%0Aimport io.fabric8.kubernetes.api.model.ConfigMap;%0Aimport io.fabric8.kubernetes.api.model.ConfigMapBuilder;%0Aimport io.fabric8.kubernetes.api.model.DoneableConfigMap;%0Aimport io.fabric8.kubernetes.client.Config;%0Aimport io.fabric8.kubernetes.client.ConfigBuilder;%0Aimport io.fabric8.kubernetes.client.DefaultKubernetesClient;%0Aimport io.fabric8.kubernetes.client.KubernetesClient;%0Aimport io.fabric8.kubernetes.client.dsl.Resource;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.util.Date;%0A%0Apublic class ConfigMapExample %7B%0A  private static final Logger logger = LoggerFactory.getLogger(ConfigMapExample.class);%0A%0A  public static void main(String%5B%5D args) throws InterruptedException %7B%0A    Config config = new ConfigBuilder().build();%0A    KubernetesClient client = new DefaultKubernetesClient(config);%0A%0A    String namespace = null;%0A    if (args.length %3E 0) %7B%0A      namespace = args%5B0%5D;%0A    %7D%0A    if (namespace == null) %7B%0A      namespace = client.getNamespace();%0A    %7D%0A    if (namespace == null) %7B%0A      namespace = %22default%22;%0A    %7D%0A%0A    String name = %22cheese%22;%0A    try %7B%0A      Resource%3CConfigMap, DoneableConfigMap%3E configMapResource = client.configMaps().inNamespace(namespace).withName(name);%0A%0A%0A      ConfigMap configMap = configMapResource.createOrReplace(new ConfigMapBuilder().%0A          withNewMetadata().withName(name).endMetadata().%0A          addToData(%22foo%22, %22%22 + new Date()).%0A          addToData(%22bar%22, %22beer%22).%0A          build());%0A%0A      log(%22Upserted ConfigMap at %22 + configMap.getMetadata().getSelfLink() + %22 data %22 + configMap.getData());%0A%0A    %7D finally %7B%0A      client.close();%0A    %7D%0A  %7D%0A%0A%0A  private static void log(String action, Object obj) %7B%0A    logger.info(%22%7B%7D: %7B%7D%22, action, obj);%0A  %7D%0A%0A  private static void log(String action) %7B%0A    logger.info(action);%0A  %7D%0A%7D%0A

add a little ConfigMap example