github.com/timstclair/heapster@v0.20.0-alpha1/Godeps/_workspace/src/k8s.io/kubernetes/pkg/client/unversioned/doc.go (about)

     1  /*
     2  Copyright 2014 The Kubernetes Authors All rights reserved.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  /*
    18  Package unversioned contains the implementation of the client side communication with the
    19  Kubernetes master. The Client class provides methods for reading, creating, updating,
    20  and deleting pods, replication controllers, daemons, services, and nodes.
    21  
    22  Most consumers should use the Config object to create a Client:
    23  
    24      import (
    25        client "k8s.io/kubernetes/pkg/client/unversioned"
    26        "k8s.io/kubernetes/pkg/api"
    27        "k8s.io/kubernetes/pkg/fields"
    28        "k8s.io/kubernetes/pkg/labels"
    29      )
    30  
    31      [...]
    32  
    33      config := &client.Config{
    34        Host:     "http://localhost:8080",
    35        Username: "test",
    36        Password: "password",
    37      }
    38      client, err := client.New(config)
    39      if err != nil {
    40        // handle error
    41      }
    42      pods, err := client.Pods(api.NamespaceDefault).List(labels.Everything(), fields.Everything())
    43      if err != nil {
    44        // handle error
    45      }
    46  
    47  More advanced consumers may wish to provide their own transport via a http.RoundTripper:
    48  
    49      config := &client.Config{
    50        Host:      "https://localhost:8080",
    51        Transport: oauthclient.Transport(),
    52      }
    53      client, err := client.New(config)
    54  
    55  The RESTClient type implements the Kubernetes API conventions (see `docs/devel/api-conventions.md`)
    56  for a given API path and is intended for use by consumers implementing their own Kubernetes
    57  compatible APIs.
    58  */
    59  package unversioned