vendor update (#34)

This commit is contained in:
Yaron Schneider 2019-10-14 23:49:50 -07:00 committed by GitHub
parent 99461da958
commit 887cd92b8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
630 changed files with 268491 additions and 4713 deletions

View File

@ -5,6 +5,7 @@
package bindings
// OutputBinding is the interface for an output binding, allowing users to invoke remote systems with optional payloads
type OutputBinding interface {
Init(metadata Metadata) error
Write(req *WriteRequest) error

1
go.mod
View File

@ -26,7 +26,6 @@ require (
github.com/eclipse/paho.mqtt.golang v1.2.0
github.com/frankban/quicktest v1.5.0 // indirect
github.com/garyburd/redigo v1.6.0 // indirect
github.com/ghodss/yaml v1.0.0
github.com/go-redis/redis v6.15.5+incompatible
github.com/google/btree v1.0.0 // indirect
github.com/google/pprof v0.0.0-20190908185732-236ed259b199 // indirect

View File

@ -197,7 +197,7 @@ func (r *StateStore) setValue(req *state.SetRequest) error {
ver = 0
}
bt := []byte{}
var bt []byte
b, ok := req.Value.([]byte)
if ok {
bt = b

View File

@ -62,9 +62,8 @@ func SetWithRetries(method func(req *SetRequest) error, req *SetRequest) error {
}
}
return fmt.Errorf("failed to set value after %d retries", req.Options.RetryPolicy.Threshold)
} else {
return method(req)
}
return method(req)
default:
return fmt.Errorf("unrecognized retry patter '%s'", req.Options.RetryPolicy.Pattern)
}
@ -91,9 +90,8 @@ func DeleteWithRetries(method func(req *DeleteRequest) error, req *DeleteRequest
}
}
return fmt.Errorf("failed to set value after %d retries", req.Options.RetryPolicy.Threshold)
} else {
return method(req)
}
return method(req)
default:
return fmt.Errorf("unrecognized retry patter '%s'", req.Options.RetryPolicy.Pattern)
}

20
vendor/github.com/ghodss/yaml/.gitignore generated vendored Normal file
View File

@ -0,0 +1,20 @@
# OSX leaves these everywhere on SMB shares
._*
# Eclipse files
.classpath
.project
.settings/**
# Emacs save files
*~
# Vim-related files
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
# Go test binaries
*.test

7
vendor/github.com/ghodss/yaml/.travis.yml generated vendored Normal file
View File

@ -0,0 +1,7 @@
language: go
go:
- 1.3
- 1.4
script:
- go test
- go build

50
vendor/github.com/ghodss/yaml/LICENSE generated vendored Normal file
View File

@ -0,0 +1,50 @@
The MIT License (MIT)
Copyright (c) 2014 Sam Ghods
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Copyright (c) 2012 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

121
vendor/github.com/ghodss/yaml/README.md generated vendored Normal file
View File

@ -0,0 +1,121 @@
# YAML marshaling and unmarshaling support for Go
[![Build Status](https://travis-ci.org/ghodss/yaml.svg)](https://travis-ci.org/ghodss/yaml)
## Introduction
A wrapper around [go-yaml](https://github.com/go-yaml/yaml) designed to enable a better way of handling YAML when marshaling to and from structs.
In short, this library first converts YAML to JSON using go-yaml and then uses `json.Marshal` and `json.Unmarshal` to convert to or from the struct. This means that it effectively reuses the JSON struct tags as well as the custom JSON methods `MarshalJSON` and `UnmarshalJSON` unlike go-yaml. For a detailed overview of the rationale behind this method, [see this blog post](http://ghodss.com/2014/the-right-way-to-handle-yaml-in-golang/).
## Compatibility
This package uses [go-yaml](https://github.com/go-yaml/yaml) and therefore supports [everything go-yaml supports](https://github.com/go-yaml/yaml#compatibility).
## Caveats
**Caveat #1:** When using `yaml.Marshal` and `yaml.Unmarshal`, binary data should NOT be preceded with the `!!binary` YAML tag. If you do, go-yaml will convert the binary data from base64 to native binary data, which is not compatible with JSON. You can still use binary in your YAML files though - just store them without the `!!binary` tag and decode the base64 in your code (e.g. in the custom JSON methods `MarshalJSON` and `UnmarshalJSON`). This also has the benefit that your YAML and your JSON binary data will be decoded exactly the same way. As an example:
```
BAD:
exampleKey: !!binary gIGC
GOOD:
exampleKey: gIGC
... and decode the base64 data in your code.
```
**Caveat #2:** When using `YAMLToJSON` directly, maps with keys that are maps will result in an error since this is not supported by JSON. This error will occur in `Unmarshal` as well since you can't unmarshal map keys anyways since struct fields can't be keys.
## Installation and usage
To install, run:
```
$ go get github.com/ghodss/yaml
```
And import using:
```
import "github.com/ghodss/yaml"
```
Usage is very similar to the JSON library:
```go
package main
import (
"fmt"
"github.com/ghodss/yaml"
)
type Person struct {
Name string `json:"name"` // Affects YAML field names too.
Age int `json:"age"`
}
func main() {
// Marshal a Person struct to YAML.
p := Person{"John", 30}
y, err := yaml.Marshal(p)
if err != nil {
fmt.Printf("err: %v\n", err)
return
}
fmt.Println(string(y))
/* Output:
age: 30
name: John
*/
// Unmarshal the YAML back into a Person struct.
var p2 Person
err = yaml.Unmarshal(y, &p2)
if err != nil {
fmt.Printf("err: %v\n", err)
return
}
fmt.Println(p2)
/* Output:
{John 30}
*/
}
```
`yaml.YAMLToJSON` and `yaml.JSONToYAML` methods are also available:
```go
package main
import (
"fmt"
"github.com/ghodss/yaml"
)
func main() {
j := []byte(`{"name": "John", "age": 30}`)
y, err := yaml.JSONToYAML(j)
if err != nil {
fmt.Printf("err: %v\n", err)
return
}
fmt.Println(string(y))
/* Output:
name: John
age: 30
*/
j2, err := yaml.YAMLToJSON(y)
if err != nil {
fmt.Printf("err: %v\n", err)
return
}
fmt.Println(string(j2))
/* Output:
{"age":30,"name":"John"}
*/
}
```

501
vendor/github.com/ghodss/yaml/fields.go generated vendored Normal file
View File

@ -0,0 +1,501 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package yaml
import (
"bytes"
"encoding"
"encoding/json"
"reflect"
"sort"
"strings"
"sync"
"unicode"
"unicode/utf8"
)
// indirect walks down v allocating pointers as needed,
// until it gets to a non-pointer.
// if it encounters an Unmarshaler, indirect stops and returns that.
// if decodingNull is true, indirect stops at the last pointer so it can be set to nil.
func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.TextUnmarshaler, reflect.Value) {
// If v is a named type and is addressable,
// start with its address, so that if the type has pointer methods,
// we find them.
if v.Kind() != reflect.Ptr && v.Type().Name() != "" && v.CanAddr() {
v = v.Addr()
}
for {
// Load value from interface, but only if the result will be
// usefully addressable.
if v.Kind() == reflect.Interface && !v.IsNil() {
e := v.Elem()
if e.Kind() == reflect.Ptr && !e.IsNil() && (!decodingNull || e.Elem().Kind() == reflect.Ptr) {
v = e
continue
}
}
if v.Kind() != reflect.Ptr {
break
}
if v.Elem().Kind() != reflect.Ptr && decodingNull && v.CanSet() {
break
}
if v.IsNil() {
if v.CanSet() {
v.Set(reflect.New(v.Type().Elem()))
} else {
v = reflect.New(v.Type().Elem())
}
}
if v.Type().NumMethod() > 0 {
if u, ok := v.Interface().(json.Unmarshaler); ok {
return u, nil, reflect.Value{}
}
if u, ok := v.Interface().(encoding.TextUnmarshaler); ok {
return nil, u, reflect.Value{}
}
}
v = v.Elem()
}
return nil, nil, v
}
// A field represents a single field found in a struct.
type field struct {
name string
nameBytes []byte // []byte(name)
equalFold func(s, t []byte) bool // bytes.EqualFold or equivalent
tag bool
index []int
typ reflect.Type
omitEmpty bool
quoted bool
}
func fillField(f field) field {
f.nameBytes = []byte(f.name)
f.equalFold = foldFunc(f.nameBytes)
return f
}
// byName sorts field by name, breaking ties with depth,
// then breaking ties with "name came from json tag", then
// breaking ties with index sequence.
type byName []field
func (x byName) Len() int { return len(x) }
func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
func (x byName) Less(i, j int) bool {
if x[i].name != x[j].name {
return x[i].name < x[j].name
}
if len(x[i].index) != len(x[j].index) {
return len(x[i].index) < len(x[j].index)
}
if x[i].tag != x[j].tag {
return x[i].tag
}
return byIndex(x).Less(i, j)
}
// byIndex sorts field by index sequence.
type byIndex []field
func (x byIndex) Len() int { return len(x) }
func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
func (x byIndex) Less(i, j int) bool {
for k, xik := range x[i].index {
if k >= len(x[j].index) {
return false
}
if xik != x[j].index[k] {
return xik < x[j].index[k]
}
}
return len(x[i].index) < len(x[j].index)
}
// typeFields returns a list of fields that JSON should recognize for the given type.
// The algorithm is breadth-first search over the set of structs to include - the top struct
// and then any reachable anonymous structs.
func typeFields(t reflect.Type) []field {
// Anonymous fields to explore at the current level and the next.
current := []field{}
next := []field{{typ: t}}
// Count of queued names for current level and the next.
count := map[reflect.Type]int{}
nextCount := map[reflect.Type]int{}
// Types already visited at an earlier level.
visited := map[reflect.Type]bool{}
// Fields found.
var fields []field
for len(next) > 0 {
current, next = next, current[:0]
count, nextCount = nextCount, map[reflect.Type]int{}
for _, f := range current {
if visited[f.typ] {
continue
}
visited[f.typ] = true
// Scan f.typ for fields to include.
for i := 0; i < f.typ.NumField(); i++ {
sf := f.typ.Field(i)
if sf.PkgPath != "" { // unexported
continue
}
tag := sf.Tag.Get("json")
if tag == "-" {
continue
}
name, opts := parseTag(tag)
if !isValidTag(name) {
name = ""
}
index := make([]int, len(f.index)+1)
copy(index, f.index)
index[len(f.index)] = i
ft := sf.Type
if ft.Name() == "" && ft.Kind() == reflect.Ptr {
// Follow pointer.
ft = ft.Elem()
}
// Record found field and index sequence.
if name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct {
tagged := name != ""
if name == "" {
name = sf.Name
}
fields = append(fields, fillField(field{
name: name,
tag: tagged,
index: index,
typ: ft,
omitEmpty: opts.Contains("omitempty"),
quoted: opts.Contains("string"),
}))
if count[f.typ] > 1 {
// If there were multiple instances, add a second,
// so that the annihilation code will see a duplicate.
// It only cares about the distinction between 1 or 2,
// so don't bother generating any more copies.
fields = append(fields, fields[len(fields)-1])
}
continue
}
// Record new anonymous struct to explore in next round.
nextCount[ft]++
if nextCount[ft] == 1 {
next = append(next, fillField(field{name: ft.Name(), index: index, typ: ft}))
}
}
}
}
sort.Sort(byName(fields))
// Delete all fields that are hidden by the Go rules for embedded fields,
// except that fields with JSON tags are promoted.
// The fields are sorted in primary order of name, secondary order
// of field index length. Loop over names; for each name, delete
// hidden fields by choosing the one dominant field that survives.
out := fields[:0]
for advance, i := 0, 0; i < len(fields); i += advance {
// One iteration per name.
// Find the sequence of fields with the name of this first field.
fi := fields[i]
name := fi.name
for advance = 1; i+advance < len(fields); advance++ {
fj := fields[i+advance]
if fj.name != name {
break
}
}
if advance == 1 { // Only one field with this name
out = append(out, fi)
continue
}
dominant, ok := dominantField(fields[i : i+advance])
if ok {
out = append(out, dominant)
}
}
fields = out
sort.Sort(byIndex(fields))
return fields
}
// dominantField looks through the fields, all of which are known to
// have the same name, to find the single field that dominates the
// others using Go's embedding rules, modified by the presence of
// JSON tags. If there are multiple top-level fields, the boolean
// will be false: This condition is an error in Go and we skip all
// the fields.
func dominantField(fields []field) (field, bool) {
// The fields are sorted in increasing index-length order. The winner
// must therefore be one with the shortest index length. Drop all
// longer entries, which is easy: just truncate the slice.
length := len(fields[0].index)
tagged := -1 // Index of first tagged field.
for i, f := range fields {
if len(f.index) > length {
fields = fields[:i]
break
}
if f.tag {
if tagged >= 0 {
// Multiple tagged fields at the same level: conflict.
// Return no field.
return field{}, false
}
tagged = i
}
}
if tagged >= 0 {
return fields[tagged], true
}
// All remaining fields have the same length. If there's more than one,
// we have a conflict (two fields named "X" at the same level) and we
// return no field.
if len(fields) > 1 {
return field{}, false
}
return fields[0], true
}
var fieldCache struct {
sync.RWMutex
m map[reflect.Type][]field
}
// cachedTypeFields is like typeFields but uses a cache to avoid repeated work.
func cachedTypeFields(t reflect.Type) []field {
fieldCache.RLock()
f := fieldCache.m[t]
fieldCache.RUnlock()
if f != nil {
return f
}
// Compute fields without lock.
// Might duplicate effort but won't hold other computations back.
f = typeFields(t)
if f == nil {
f = []field{}
}
fieldCache.Lock()
if fieldCache.m == nil {
fieldCache.m = map[reflect.Type][]field{}
}
fieldCache.m[t] = f
fieldCache.Unlock()
return f
}
func isValidTag(s string) bool {
if s == "" {
return false
}
for _, c := range s {
switch {
case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c):
// Backslash and quote chars are reserved, but
// otherwise any punctuation chars are allowed
// in a tag name.
default:
if !unicode.IsLetter(c) && !unicode.IsDigit(c) {
return false
}
}
}
return true
}
const (
caseMask = ^byte(0x20) // Mask to ignore case in ASCII.
kelvin = '\u212a'
smallLongEss = '\u017f'
)
// foldFunc returns one of four different case folding equivalence
// functions, from most general (and slow) to fastest:
//
// 1) bytes.EqualFold, if the key s contains any non-ASCII UTF-8
// 2) equalFoldRight, if s contains special folding ASCII ('k', 'K', 's', 'S')
// 3) asciiEqualFold, no special, but includes non-letters (including _)
// 4) simpleLetterEqualFold, no specials, no non-letters.
//
// The letters S and K are special because they map to 3 runes, not just 2:
// * S maps to s and to U+017F 'ſ' Latin small letter long s
// * k maps to K and to U+212A '' Kelvin sign
// See http://play.golang.org/p/tTxjOc0OGo
//
// The returned function is specialized for matching against s and
// should only be given s. It's not curried for performance reasons.
func foldFunc(s []byte) func(s, t []byte) bool {
nonLetter := false
special := false // special letter
for _, b := range s {
if b >= utf8.RuneSelf {
return bytes.EqualFold
}
upper := b & caseMask
if upper < 'A' || upper > 'Z' {
nonLetter = true
} else if upper == 'K' || upper == 'S' {
// See above for why these letters are special.
special = true
}
}
if special {
return equalFoldRight
}
if nonLetter {
return asciiEqualFold
}
return simpleLetterEqualFold
}
// equalFoldRight is a specialization of bytes.EqualFold when s is
// known to be all ASCII (including punctuation), but contains an 's',
// 'S', 'k', or 'K', requiring a Unicode fold on the bytes in t.
// See comments on foldFunc.
func equalFoldRight(s, t []byte) bool {
for _, sb := range s {
if len(t) == 0 {
return false
}
tb := t[0]
if tb < utf8.RuneSelf {
if sb != tb {
sbUpper := sb & caseMask
if 'A' <= sbUpper && sbUpper <= 'Z' {
if sbUpper != tb&caseMask {
return false
}
} else {
return false
}
}
t = t[1:]
continue
}
// sb is ASCII and t is not. t must be either kelvin
// sign or long s; sb must be s, S, k, or K.
tr, size := utf8.DecodeRune(t)
switch sb {
case 's', 'S':
if tr != smallLongEss {
return false
}
case 'k', 'K':
if tr != kelvin {
return false
}
default:
return false
}
t = t[size:]
}
if len(t) > 0 {
return false
}
return true
}
// asciiEqualFold is a specialization of bytes.EqualFold for use when
// s is all ASCII (but may contain non-letters) and contains no
// special-folding letters.
// See comments on foldFunc.
func asciiEqualFold(s, t []byte) bool {
if len(s) != len(t) {
return false
}
for i, sb := range s {
tb := t[i]
if sb == tb {
continue
}
if ('a' <= sb && sb <= 'z') || ('A' <= sb && sb <= 'Z') {
if sb&caseMask != tb&caseMask {
return false
}
} else {
return false
}
}
return true
}
// simpleLetterEqualFold is a specialization of bytes.EqualFold for
// use when s is all ASCII letters (no underscores, etc) and also
// doesn't contain 'k', 'K', 's', or 'S'.
// See comments on foldFunc.
func simpleLetterEqualFold(s, t []byte) bool {
if len(s) != len(t) {
return false
}
for i, b := range s {
if b&caseMask != t[i]&caseMask {
return false
}
}
return true
}
// tagOptions is the string following a comma in a struct field's "json"
// tag, or the empty string. It does not include the leading comma.
type tagOptions string
// parseTag splits a struct field's json tag into its name and
// comma-separated options.
func parseTag(tag string) (string, tagOptions) {
if idx := strings.Index(tag, ","); idx != -1 {
return tag[:idx], tagOptions(tag[idx+1:])
}
return tag, tagOptions("")
}
// Contains reports whether a comma-separated list of options
// contains a particular substr flag. substr must be surrounded by a
// string boundary or commas.
func (o tagOptions) Contains(optionName string) bool {
if len(o) == 0 {
return false
}
s := string(o)
for s != "" {
var next string
i := strings.Index(s, ",")
if i >= 0 {
s, next = s[:i], s[i+1:]
}
if s == optionName {
return true
}
s = next
}
return false
}

277
vendor/github.com/ghodss/yaml/yaml.go generated vendored Normal file
View File

@ -0,0 +1,277 @@
package yaml
import (
"bytes"
"encoding/json"
"fmt"
"reflect"
"strconv"
"gopkg.in/yaml.v2"
)
// Marshals the object into JSON then converts JSON to YAML and returns the
// YAML.
func Marshal(o interface{}) ([]byte, error) {
j, err := json.Marshal(o)
if err != nil {
return nil, fmt.Errorf("error marshaling into JSON: %v", err)
}
y, err := JSONToYAML(j)
if err != nil {
return nil, fmt.Errorf("error converting JSON to YAML: %v", err)
}
return y, nil
}
// Converts YAML to JSON then uses JSON to unmarshal into an object.
func Unmarshal(y []byte, o interface{}) error {
vo := reflect.ValueOf(o)
j, err := yamlToJSON(y, &vo)
if err != nil {
return fmt.Errorf("error converting YAML to JSON: %v", err)
}
err = json.Unmarshal(j, o)
if err != nil {
return fmt.Errorf("error unmarshaling JSON: %v", err)
}
return nil
}
// Convert JSON to YAML.
func JSONToYAML(j []byte) ([]byte, error) {
// Convert the JSON to an object.
var jsonObj interface{}
// We are using yaml.Unmarshal here (instead of json.Unmarshal) because the
// Go JSON library doesn't try to pick the right number type (int, float,
// etc.) when unmarshalling to interface{}, it just picks float64
// universally. go-yaml does go through the effort of picking the right
// number type, so we can preserve number type throughout this process.
err := yaml.Unmarshal(j, &jsonObj)
if err != nil {
return nil, err
}
// Marshal this object into YAML.
return yaml.Marshal(jsonObj)
}
// Convert YAML to JSON. Since JSON is a subset of YAML, passing JSON through
// this method should be a no-op.
//
// Things YAML can do that are not supported by JSON:
// * In YAML you can have binary and null keys in your maps. These are invalid
// in JSON. (int and float keys are converted to strings.)
// * Binary data in YAML with the !!binary tag is not supported. If you want to
// use binary data with this library, encode the data as base64 as usual but do
// not use the !!binary tag in your YAML. This will ensure the original base64
// encoded data makes it all the way through to the JSON.
func YAMLToJSON(y []byte) ([]byte, error) {
return yamlToJSON(y, nil)
}
func yamlToJSON(y []byte, jsonTarget *reflect.Value) ([]byte, error) {
// Convert the YAML to an object.
var yamlObj interface{}
err := yaml.Unmarshal(y, &yamlObj)
if err != nil {
return nil, err
}
// YAML objects are not completely compatible with JSON objects (e.g. you
// can have non-string keys in YAML). So, convert the YAML-compatible object
// to a JSON-compatible object, failing with an error if irrecoverable
// incompatibilties happen along the way.
jsonObj, err := convertToJSONableObject(yamlObj, jsonTarget)
if err != nil {
return nil, err
}
// Convert this object to JSON and return the data.
return json.Marshal(jsonObj)
}
func convertToJSONableObject(yamlObj interface{}, jsonTarget *reflect.Value) (interface{}, error) {
var err error
// Resolve jsonTarget to a concrete value (i.e. not a pointer or an
// interface). We pass decodingNull as false because we're not actually
// decoding into the value, we're just checking if the ultimate target is a
// string.
if jsonTarget != nil {
ju, tu, pv := indirect(*jsonTarget, false)
// We have a JSON or Text Umarshaler at this level, so we can't be trying
// to decode into a string.
if ju != nil || tu != nil {
jsonTarget = nil
} else {
jsonTarget = &pv
}
}
// If yamlObj is a number or a boolean, check if jsonTarget is a string -
// if so, coerce. Else return normal.
// If yamlObj is a map or array, find the field that each key is
// unmarshaling to, and when you recurse pass the reflect.Value for that
// field back into this function.
switch typedYAMLObj := yamlObj.(type) {
case map[interface{}]interface{}:
// JSON does not support arbitrary keys in a map, so we must convert
// these keys to strings.
//
// From my reading of go-yaml v2 (specifically the resolve function),
// keys can only have the types string, int, int64, float64, binary
// (unsupported), or null (unsupported).
strMap := make(map[string]interface{})
for k, v := range typedYAMLObj {
// Resolve the key to a string first.
var keyString string
switch typedKey := k.(type) {
case string:
keyString = typedKey
case int:
keyString = strconv.Itoa(typedKey)
case int64:
// go-yaml will only return an int64 as a key if the system
// architecture is 32-bit and the key's value is between 32-bit
// and 64-bit. Otherwise the key type will simply be int.
keyString = strconv.FormatInt(typedKey, 10)
case float64:
// Stolen from go-yaml to use the same conversion to string as
// the go-yaml library uses to convert float to string when
// Marshaling.
s := strconv.FormatFloat(typedKey, 'g', -1, 32)
switch s {
case "+Inf":
s = ".inf"
case "-Inf":
s = "-.inf"
case "NaN":
s = ".nan"
}
keyString = s
case bool:
if typedKey {
keyString = "true"
} else {
keyString = "false"
}
default:
return nil, fmt.Errorf("Unsupported map key of type: %s, key: %+#v, value: %+#v",
reflect.TypeOf(k), k, v)
}
// jsonTarget should be a struct or a map. If it's a struct, find
// the field it's going to map to and pass its reflect.Value. If
// it's a map, find the element type of the map and pass the
// reflect.Value created from that type. If it's neither, just pass
// nil - JSON conversion will error for us if it's a real issue.
if jsonTarget != nil {
t := *jsonTarget
if t.Kind() == reflect.Struct {
keyBytes := []byte(keyString)
// Find the field that the JSON library would use.
var f *field
fields := cachedTypeFields(t.Type())
for i := range fields {
ff := &fields[i]
if bytes.Equal(ff.nameBytes, keyBytes) {
f = ff
break
}
// Do case-insensitive comparison.
if f == nil && ff.equalFold(ff.nameBytes, keyBytes) {
f = ff
}
}
if f != nil {
// Find the reflect.Value of the most preferential
// struct field.
jtf := t.Field(f.index[0])
strMap[keyString], err = convertToJSONableObject(v, &jtf)
if err != nil {
return nil, err
}
continue
}
} else if t.Kind() == reflect.Map {
// Create a zero value of the map's element type to use as
// the JSON target.
jtv := reflect.Zero(t.Type().Elem())
strMap[keyString], err = convertToJSONableObject(v, &jtv)
if err != nil {
return nil, err
}
continue
}
}
strMap[keyString], err = convertToJSONableObject(v, nil)
if err != nil {
return nil, err
}
}
return strMap, nil
case []interface{}:
// We need to recurse into arrays in case there are any
// map[interface{}]interface{}'s inside and to convert any
// numbers to strings.
// If jsonTarget is a slice (which it really should be), find the
// thing it's going to map to. If it's not a slice, just pass nil
// - JSON conversion will error for us if it's a real issue.
var jsonSliceElemValue *reflect.Value
if jsonTarget != nil {
t := *jsonTarget
if t.Kind() == reflect.Slice {
// By default slices point to nil, but we need a reflect.Value
// pointing to a value of the slice type, so we create one here.
ev := reflect.Indirect(reflect.New(t.Type().Elem()))
jsonSliceElemValue = &ev
}
}
// Make and use a new array.
arr := make([]interface{}, len(typedYAMLObj))
for i, v := range typedYAMLObj {
arr[i], err = convertToJSONableObject(v, jsonSliceElemValue)
if err != nil {
return nil, err
}
}
return arr, nil
default:
// If the target type is a string and the YAML type is a number,
// convert the YAML type to a string.
if jsonTarget != nil && (*jsonTarget).Kind() == reflect.String {
// Based on my reading of go-yaml, it may return int, int64,
// float64, or uint64.
var s string
switch typedVal := typedYAMLObj.(type) {
case int:
s = strconv.FormatInt(int64(typedVal), 10)
case int64:
s = strconv.FormatInt(typedVal, 10)
case float64:
s = strconv.FormatFloat(typedVal, 'g', -1, 32)
case uint64:
s = strconv.FormatUint(typedVal, 10)
case bool:
if typedVal {
s = "true"
} else {
s = "false"
}
}
if len(s) > 0 {
yamlObj = interface{}(s)
}
}
return yamlObj, nil
}
return nil, nil
}

191
vendor/github.com/golang/glog/LICENSE generated vendored Normal file
View File

@ -0,0 +1,191 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "[]" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

44
vendor/github.com/golang/glog/README generated vendored Normal file
View File

@ -0,0 +1,44 @@
glog
====
Leveled execution logs for Go.
This is an efficient pure Go implementation of leveled logs in the
manner of the open source C++ package
https://github.com/google/glog
By binding methods to booleans it is possible to use the log package
without paying the expense of evaluating the arguments to the log.
Through the -vmodule flag, the package also provides fine-grained
control over logging at the file level.
The comment from glog.go introduces the ideas:
Package glog implements logging analogous to the Google-internal
C++ INFO/ERROR/V setup. It provides functions Info, Warning,
Error, Fatal, plus formatting variants such as Infof. It
also provides V-style logging controlled by the -v and
-vmodule=file=2 flags.
Basic examples:
glog.Info("Prepare to repel boarders")
glog.Fatalf("Initialization failed: %s", err)
See the documentation for the V function for an explanation
of these examples:
if glog.V(2) {
glog.Info("Starting transaction...")
}
glog.V(2).Infoln("Processed", nItems, "elements")
The repository contains an open source version of the log package
used inside Google. The master copy of the source lives inside
Google, not here. The code in this repo is for export only and is not itself
under development. Feature requests will be ignored.
Send bug reports to golang-nuts@googlegroups.com.

1180
vendor/github.com/golang/glog/glog.go generated vendored Normal file

File diff suppressed because it is too large Load Diff

124
vendor/github.com/golang/glog/glog_file.go generated vendored Normal file
View File

@ -0,0 +1,124 @@
// Go support for leveled logs, analogous to https://code.google.com/p/google-glog/
//
// Copyright 2013 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// File I/O for logs.
package glog
import (
"errors"
"flag"
"fmt"
"os"
"os/user"
"path/filepath"
"strings"
"sync"
"time"
)
// MaxSize is the maximum size of a log file in bytes.
var MaxSize uint64 = 1024 * 1024 * 1800
// logDirs lists the candidate directories for new log files.
var logDirs []string
// If non-empty, overrides the choice of directory in which to write logs.
// See createLogDirs for the full list of possible destinations.
var logDir = flag.String("log_dir", "", "If non-empty, write log files in this directory")
func createLogDirs() {
if *logDir != "" {
logDirs = append(logDirs, *logDir)
}
logDirs = append(logDirs, os.TempDir())
}
var (
pid = os.Getpid()
program = filepath.Base(os.Args[0])
host = "unknownhost"
userName = "unknownuser"
)
func init() {
h, err := os.Hostname()
if err == nil {
host = shortHostname(h)
}
current, err := user.Current()
if err == nil {
userName = current.Username
}
// Sanitize userName since it may contain filepath separators on Windows.
userName = strings.Replace(userName, `\`, "_", -1)
}
// shortHostname returns its argument, truncating at the first period.
// For instance, given "www.google.com" it returns "www".
func shortHostname(hostname string) string {
if i := strings.Index(hostname, "."); i >= 0 {
return hostname[:i]
}
return hostname
}
// logName returns a new log file name containing tag, with start time t, and
// the name for the symlink for tag.
func logName(tag string, t time.Time) (name, link string) {
name = fmt.Sprintf("%s.%s.%s.log.%s.%04d%02d%02d-%02d%02d%02d.%d",
program,
host,
userName,
tag,
t.Year(),
t.Month(),
t.Day(),
t.Hour(),
t.Minute(),
t.Second(),
pid)
return name, program + "." + tag
}
var onceLogDirs sync.Once
// create creates a new log file and returns the file and its filename, which
// contains tag ("INFO", "FATAL", etc.) and t. If the file is created
// successfully, create also attempts to update the symlink for that tag, ignoring
// errors.
func create(tag string, t time.Time) (f *os.File, filename string, err error) {
onceLogDirs.Do(createLogDirs)
if len(logDirs) == 0 {
return nil, "", errors.New("log: no log dirs")
}
name, link := logName(tag, t)
var lastErr error
for _, dir := range logDirs {
fname := filepath.Join(dir, name)
f, err := os.Create(fname)
if err == nil {
symlink := filepath.Join(dir, link)
os.Remove(symlink) // ignore err
os.Symlink(name, symlink) // ignore err
return f, fname, nil
}
lastErr = err
}
return nil, "", fmt.Errorf("log: cannot create log: %v", lastErr)
}

201
vendor/github.com/kubernetes-client/go/LICENSE generated vendored Normal file
View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof

View File

@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,8 @@
language: go
install:
- go get -d -v .
script:
- go build -v ./

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type AdmissionregistrationApiService service
/* AdmissionregistrationApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *AdmissionregistrationApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,870 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type AdmissionregistrationV1alpha1ApiService service
/* AdmissionregistrationV1alpha1ApiService
create an InitializerConfiguration
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1alpha1InitializerConfiguration*/
func (a *AdmissionregistrationV1alpha1ApiService) CreateInitializerConfiguration(ctx context.Context, body V1alpha1InitializerConfiguration, localVarOptionals map[string]interface{}) (V1alpha1InitializerConfiguration, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1alpha1InitializerConfiguration
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AdmissionregistrationV1alpha1ApiService
delete collection of InitializerConfiguration
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1Status*/
func (a *AdmissionregistrationV1alpha1ApiService) DeleteCollectionInitializerConfiguration(ctx context.Context, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AdmissionregistrationV1alpha1ApiService
delete an InitializerConfiguration
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the InitializerConfiguration
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; - allow the garbage collector to delete the dependents in the background; &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground.
@return V1Status*/
func (a *AdmissionregistrationV1alpha1ApiService) DeleteInitializerConfiguration(ctx context.Context, name string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AdmissionregistrationV1alpha1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *AdmissionregistrationV1alpha1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AdmissionregistrationV1alpha1ApiService
list or watch objects of kind InitializerConfiguration
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1alpha1InitializerConfigurationList*/
func (a *AdmissionregistrationV1alpha1ApiService) ListInitializerConfiguration(ctx context.Context, localVarOptionals map[string]interface{}) (V1alpha1InitializerConfigurationList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1alpha1InitializerConfigurationList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
"application/json;stream=watch",
"application/vnd.kubernetes.protobuf;stream=watch",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AdmissionregistrationV1alpha1ApiService
partially update the specified InitializerConfiguration
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the InitializerConfiguration
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1alpha1InitializerConfiguration*/
func (a *AdmissionregistrationV1alpha1ApiService) PatchInitializerConfiguration(ctx context.Context, name string, body interface{}, localVarOptionals map[string]interface{}) (V1alpha1InitializerConfiguration, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Patch")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1alpha1InitializerConfiguration
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AdmissionregistrationV1alpha1ApiService
read the specified InitializerConfiguration
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the InitializerConfiguration
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "exact" (bool) Should the export be exact. Exact export maintains cluster-specific fields like &#39;Namespace&#39;.
@param "export" (bool) Should this value be exported. Export strips fields that a user can not specify.
@return V1alpha1InitializerConfiguration*/
func (a *AdmissionregistrationV1alpha1ApiService) ReadInitializerConfiguration(ctx context.Context, name string, localVarOptionals map[string]interface{}) (V1alpha1InitializerConfiguration, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1alpha1InitializerConfiguration
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["exact"], "bool", "exact"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["export"], "bool", "export"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["exact"].(bool); localVarOk {
localVarQueryParams.Add("exact", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["export"].(bool); localVarOk {
localVarQueryParams.Add("export", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AdmissionregistrationV1alpha1ApiService
replace the specified InitializerConfiguration
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the InitializerConfiguration
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1alpha1InitializerConfiguration*/
func (a *AdmissionregistrationV1alpha1ApiService) ReplaceInitializerConfiguration(ctx context.Context, name string, body V1alpha1InitializerConfiguration, localVarOptionals map[string]interface{}) (V1alpha1InitializerConfiguration, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1alpha1InitializerConfiguration
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// ServiceReference holds a reference to Service.legacy.k8s.io
type AdmissionregistrationV1beta1ServiceReference struct {
// `name` is the name of the service. Required
Name string `json:"name"`
// `namespace` is the namespace of the service. Required
Namespace string `json:"namespace"`
// `path` is an optional URL path which will be sent in any request to this service.
Path string `json:"path,omitempty"`
}

View File

@ -0,0 +1,535 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"bytes"
"encoding/json"
"encoding/xml"
"fmt"
"errors"
"io"
"mime/multipart"
"golang.org/x/oauth2"
"golang.org/x/net/context"
"net/http"
"net/url"
"time"
"os"
"path/filepath"
"reflect"
"regexp"
"strings"
"unicode/utf8"
"strconv"
)
var (
jsonCheck = regexp.MustCompile("(?i:[application|text]/json)")
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
)
// APIClient manages communication with the Kubernetes API vv1.10.0
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
// API Services
AdmissionregistrationApi *AdmissionregistrationApiService
AdmissionregistrationV1alpha1Api *AdmissionregistrationV1alpha1ApiService
AdmissionregistrationV1beta1Api *AdmissionregistrationV1beta1ApiService
ApiextensionsApi *ApiextensionsApiService
ApiextensionsV1beta1Api *ApiextensionsV1beta1ApiService
ApiregistrationApi *ApiregistrationApiService
ApiregistrationV1Api *ApiregistrationV1ApiService
ApiregistrationV1beta1Api *ApiregistrationV1beta1ApiService
ApisApi *ApisApiService
AppsApi *AppsApiService
AppsV1Api *AppsV1ApiService
AppsV1beta1Api *AppsV1beta1ApiService
AppsV1beta2Api *AppsV1beta2ApiService
AuthenticationApi *AuthenticationApiService
AuthenticationV1Api *AuthenticationV1ApiService
AuthenticationV1beta1Api *AuthenticationV1beta1ApiService
AuthorizationApi *AuthorizationApiService
AuthorizationV1Api *AuthorizationV1ApiService
AuthorizationV1beta1Api *AuthorizationV1beta1ApiService
AutoscalingApi *AutoscalingApiService
AutoscalingV1Api *AutoscalingV1ApiService
AutoscalingV2beta1Api *AutoscalingV2beta1ApiService
BatchApi *BatchApiService
BatchV1Api *BatchV1ApiService
BatchV1beta1Api *BatchV1beta1ApiService
BatchV2alpha1Api *BatchV2alpha1ApiService
CertificatesApi *CertificatesApiService
CertificatesV1beta1Api *CertificatesV1beta1ApiService
CoreApi *CoreApiService
CoreV1Api *CoreV1ApiService
CustomObjectsApi *CustomObjectsApiService
EventsApi *EventsApiService
EventsV1beta1Api *EventsV1beta1ApiService
ExtensionsApi *ExtensionsApiService
ExtensionsV1beta1Api *ExtensionsV1beta1ApiService
LogsApi *LogsApiService
NetworkingApi *NetworkingApiService
NetworkingV1Api *NetworkingV1ApiService
PolicyApi *PolicyApiService
PolicyV1beta1Api *PolicyV1beta1ApiService
RbacAuthorizationApi *RbacAuthorizationApiService
RbacAuthorizationV1Api *RbacAuthorizationV1ApiService
RbacAuthorizationV1alpha1Api *RbacAuthorizationV1alpha1ApiService
RbacAuthorizationV1beta1Api *RbacAuthorizationV1beta1ApiService
SchedulingApi *SchedulingApiService
SchedulingV1alpha1Api *SchedulingV1alpha1ApiService
SettingsApi *SettingsApiService
SettingsV1alpha1Api *SettingsV1alpha1ApiService
StorageApi *StorageApiService
StorageV1Api *StorageV1ApiService
StorageV1alpha1Api *StorageV1alpha1ApiService
StorageV1beta1Api *StorageV1beta1ApiService
VersionApi *VersionApiService
}
type service struct {
client *APIClient
}
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
// optionally a custom http.Client to allow for advanced features such as caching.
func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.HTTPClient == nil {
cfg.HTTPClient = http.DefaultClient
}
c := &APIClient{}
c.cfg = cfg
c.common.client = c
// API Services
c.AdmissionregistrationApi = (*AdmissionregistrationApiService)(&c.common)
c.AdmissionregistrationV1alpha1Api = (*AdmissionregistrationV1alpha1ApiService)(&c.common)
c.AdmissionregistrationV1beta1Api = (*AdmissionregistrationV1beta1ApiService)(&c.common)
c.ApiextensionsApi = (*ApiextensionsApiService)(&c.common)
c.ApiextensionsV1beta1Api = (*ApiextensionsV1beta1ApiService)(&c.common)
c.ApiregistrationApi = (*ApiregistrationApiService)(&c.common)
c.ApiregistrationV1Api = (*ApiregistrationV1ApiService)(&c.common)
c.ApiregistrationV1beta1Api = (*ApiregistrationV1beta1ApiService)(&c.common)
c.ApisApi = (*ApisApiService)(&c.common)
c.AppsApi = (*AppsApiService)(&c.common)
c.AppsV1Api = (*AppsV1ApiService)(&c.common)
c.AppsV1beta1Api = (*AppsV1beta1ApiService)(&c.common)
c.AppsV1beta2Api = (*AppsV1beta2ApiService)(&c.common)
c.AuthenticationApi = (*AuthenticationApiService)(&c.common)
c.AuthenticationV1Api = (*AuthenticationV1ApiService)(&c.common)
c.AuthenticationV1beta1Api = (*AuthenticationV1beta1ApiService)(&c.common)
c.AuthorizationApi = (*AuthorizationApiService)(&c.common)
c.AuthorizationV1Api = (*AuthorizationV1ApiService)(&c.common)
c.AuthorizationV1beta1Api = (*AuthorizationV1beta1ApiService)(&c.common)
c.AutoscalingApi = (*AutoscalingApiService)(&c.common)
c.AutoscalingV1Api = (*AutoscalingV1ApiService)(&c.common)
c.AutoscalingV2beta1Api = (*AutoscalingV2beta1ApiService)(&c.common)
c.BatchApi = (*BatchApiService)(&c.common)
c.BatchV1Api = (*BatchV1ApiService)(&c.common)
c.BatchV1beta1Api = (*BatchV1beta1ApiService)(&c.common)
c.BatchV2alpha1Api = (*BatchV2alpha1ApiService)(&c.common)
c.CertificatesApi = (*CertificatesApiService)(&c.common)
c.CertificatesV1beta1Api = (*CertificatesV1beta1ApiService)(&c.common)
c.CoreApi = (*CoreApiService)(&c.common)
c.CoreV1Api = (*CoreV1ApiService)(&c.common)
c.CustomObjectsApi = (*CustomObjectsApiService)(&c.common)
c.EventsApi = (*EventsApiService)(&c.common)
c.EventsV1beta1Api = (*EventsV1beta1ApiService)(&c.common)
c.ExtensionsApi = (*ExtensionsApiService)(&c.common)
c.ExtensionsV1beta1Api = (*ExtensionsV1beta1ApiService)(&c.common)
c.LogsApi = (*LogsApiService)(&c.common)
c.NetworkingApi = (*NetworkingApiService)(&c.common)
c.NetworkingV1Api = (*NetworkingV1ApiService)(&c.common)
c.PolicyApi = (*PolicyApiService)(&c.common)
c.PolicyV1beta1Api = (*PolicyV1beta1ApiService)(&c.common)
c.RbacAuthorizationApi = (*RbacAuthorizationApiService)(&c.common)
c.RbacAuthorizationV1Api = (*RbacAuthorizationV1ApiService)(&c.common)
c.RbacAuthorizationV1alpha1Api = (*RbacAuthorizationV1alpha1ApiService)(&c.common)
c.RbacAuthorizationV1beta1Api = (*RbacAuthorizationV1beta1ApiService)(&c.common)
c.SchedulingApi = (*SchedulingApiService)(&c.common)
c.SchedulingV1alpha1Api = (*SchedulingV1alpha1ApiService)(&c.common)
c.SettingsApi = (*SettingsApiService)(&c.common)
c.SettingsV1alpha1Api = (*SettingsV1alpha1ApiService)(&c.common)
c.StorageApi = (*StorageApiService)(&c.common)
c.StorageV1Api = (*StorageV1ApiService)(&c.common)
c.StorageV1alpha1Api = (*StorageV1alpha1ApiService)(&c.common)
c.StorageV1beta1Api = (*StorageV1beta1ApiService)(&c.common)
c.VersionApi = (*VersionApiService)(&c.common)
return c
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
if contains(contentTypes, "*/*") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insenstive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.ToLower(a) == strings.ToLower(needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
func parameterToString(obj interface{}, collectionFormat string) string {
var delimiter string
switch collectionFormat {
case "pipes":
delimiter = "|"
case "ssv":
delimiter = " "
case "tsv":
delimiter = "\t"
case "csv":
delimiter = ","
}
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
}
return fmt.Sprintf("%v", obj)
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
return c.cfg.HTTPClient.Do(request)
}
// Change base path to allow switching to mocks
func (c *APIClient) ChangeBasePath (path string) {
c.cfg.BasePath = path
}
// prepareRequest build the request
func (c *APIClient) prepareRequest (
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
fileName string,
fileBytes []byte) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if postBody != nil {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
if len(fileBytes) > 0 && fileName != "" {
w.Boundary()
//_, fileNm := filepath.Split(fileName)
part, err := w.CreateFormFile("file", filepath.Base(fileName))
if err != nil {
return nil, err
}
_, err = part.Write(fileBytes)
if err != nil {
return nil, err
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
}
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = query.Encode()
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers.Set(h, v)
}
localVarRequest.Header = headers
}
// Override request host, if applicable
if c.cfg.Host != "" {
localVarRequest.Host = c.cfg.Host
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
// OAuth2 authentication
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
// We were able to grab an oauth2 token from the context
var latestToken *oauth2.Token
if latestToken, err = tok.Token(); err != nil {
return nil, err
}
latestToken.SetAuthHeader(localVarRequest)
}
// Basic HTTP Authentication
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
}
// AccessToken Authentication
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
localVarRequest.Header.Add("Authorization", "Bearer " + auth)
}
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) (error) {
return fmt.Errorf(format, a...)
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
xml.NewEncoder(bodyBuf).Encode(body)
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("Invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) (time.Time) {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
}
expires = now.Add(lifetime)
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) (int) {
return utf8.RuneCountInString(s)
}

View File

@ -0,0 +1,43 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"net/http"
)
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
func NewAPIResponse(r *http.Response) *APIResponse {
response := &APIResponse{Response: r}
return response
}
func NewAPIResponseWithError(errorMessage string) *APIResponse {
response := &APIResponse{Message: errorMessage}
return response
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type ApiextensionsApiService service
/* ApiextensionsApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *ApiextensionsApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,960 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type ApiextensionsV1beta1ApiService service
/* ApiextensionsV1beta1ApiService
create a CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1CustomResourceDefinition*/
func (a *ApiextensionsV1beta1ApiService) CreateCustomResourceDefinition(ctx context.Context, body V1beta1CustomResourceDefinition, localVarOptionals map[string]interface{}) (V1beta1CustomResourceDefinition, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1CustomResourceDefinition
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
delete collection of CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1Status*/
func (a *ApiextensionsV1beta1ApiService) DeleteCollectionCustomResourceDefinition(ctx context.Context, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
delete a CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the CustomResourceDefinition
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; - allow the garbage collector to delete the dependents in the background; &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground.
@return V1Status*/
func (a *ApiextensionsV1beta1ApiService) DeleteCustomResourceDefinition(ctx context.Context, name string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *ApiextensionsV1beta1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
list or watch objects of kind CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1beta1CustomResourceDefinitionList*/
func (a *ApiextensionsV1beta1ApiService) ListCustomResourceDefinition(ctx context.Context, localVarOptionals map[string]interface{}) (V1beta1CustomResourceDefinitionList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1CustomResourceDefinitionList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
"application/json;stream=watch",
"application/vnd.kubernetes.protobuf;stream=watch",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
partially update the specified CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the CustomResourceDefinition
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1CustomResourceDefinition*/
func (a *ApiextensionsV1beta1ApiService) PatchCustomResourceDefinition(ctx context.Context, name string, body interface{}, localVarOptionals map[string]interface{}) (V1beta1CustomResourceDefinition, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Patch")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1CustomResourceDefinition
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
read the specified CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the CustomResourceDefinition
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "exact" (bool) Should the export be exact. Exact export maintains cluster-specific fields like &#39;Namespace&#39;.
@param "export" (bool) Should this value be exported. Export strips fields that a user can not specify.
@return V1beta1CustomResourceDefinition*/
func (a *ApiextensionsV1beta1ApiService) ReadCustomResourceDefinition(ctx context.Context, name string, localVarOptionals map[string]interface{}) (V1beta1CustomResourceDefinition, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1CustomResourceDefinition
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["exact"], "bool", "exact"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["export"], "bool", "export"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["exact"].(bool); localVarOk {
localVarQueryParams.Add("exact", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["export"].(bool); localVarOk {
localVarQueryParams.Add("export", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
replace the specified CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the CustomResourceDefinition
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1CustomResourceDefinition*/
func (a *ApiextensionsV1beta1ApiService) ReplaceCustomResourceDefinition(ctx context.Context, name string, body V1beta1CustomResourceDefinition, localVarOptionals map[string]interface{}) (V1beta1CustomResourceDefinition, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1CustomResourceDefinition
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiextensionsV1beta1ApiService
replace status of the specified CustomResourceDefinition
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the CustomResourceDefinition
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1CustomResourceDefinition*/
func (a *ApiextensionsV1beta1ApiService) ReplaceCustomResourceDefinitionStatus(ctx context.Context, name string, body V1beta1CustomResourceDefinition, localVarOptionals map[string]interface{}) (V1beta1CustomResourceDefinition, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1CustomResourceDefinition
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}/status"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type ApiregistrationApiService service
/* ApiregistrationApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *ApiregistrationApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,960 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type ApiregistrationV1ApiService service
/* ApiregistrationV1ApiService
create an APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1ApiService*/
func (a *ApiregistrationV1ApiService) CreateAPIService(ctx context.Context, body V1ApiService, localVarOptionals map[string]interface{}) (V1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
delete an APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; - allow the garbage collector to delete the dependents in the background; &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground.
@return V1Status*/
func (a *ApiregistrationV1ApiService) DeleteAPIService(ctx context.Context, name string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
delete collection of APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1Status*/
func (a *ApiregistrationV1ApiService) DeleteCollectionAPIService(ctx context.Context, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *ApiregistrationV1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
list or watch objects of kind APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1ApiServiceList*/
func (a *ApiregistrationV1ApiService) ListAPIService(ctx context.Context, localVarOptionals map[string]interface{}) (V1ApiServiceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiServiceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
"application/json;stream=watch",
"application/vnd.kubernetes.protobuf;stream=watch",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
partially update the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1ApiService*/
func (a *ApiregistrationV1ApiService) PatchAPIService(ctx context.Context, name string, body interface{}, localVarOptionals map[string]interface{}) (V1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Patch")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
read the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "exact" (bool) Should the export be exact. Exact export maintains cluster-specific fields like &#39;Namespace&#39;.
@param "export" (bool) Should this value be exported. Export strips fields that a user can not specify.
@return V1ApiService*/
func (a *ApiregistrationV1ApiService) ReadAPIService(ctx context.Context, name string, localVarOptionals map[string]interface{}) (V1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["exact"], "bool", "exact"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["export"], "bool", "export"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["exact"].(bool); localVarOk {
localVarQueryParams.Add("exact", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["export"].(bool); localVarOk {
localVarQueryParams.Add("export", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
replace the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1ApiService*/
func (a *ApiregistrationV1ApiService) ReplaceAPIService(ctx context.Context, name string, body V1ApiService, localVarOptionals map[string]interface{}) (V1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1ApiService
replace status of the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1ApiService*/
func (a *ApiregistrationV1ApiService) ReplaceAPIServiceStatus(ctx context.Context, name string, body V1ApiService, localVarOptionals map[string]interface{}) (V1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1/apiservices/{name}/status"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,960 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type ApiregistrationV1beta1ApiService service
/* ApiregistrationV1beta1ApiService
create an APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1ApiService*/
func (a *ApiregistrationV1beta1ApiService) CreateAPIService(ctx context.Context, body V1beta1ApiService, localVarOptionals map[string]interface{}) (V1beta1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
delete an APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "gracePeriodSeconds" (int32) The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
@param "orphanDependents" (bool) Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers list. Either this field or PropagationPolicy may be set, but not both.
@param "propagationPolicy" (string) Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; - allow the garbage collector to delete the dependents in the background; &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground.
@return V1Status*/
func (a *ApiregistrationV1beta1ApiService) DeleteAPIService(ctx context.Context, name string, body V1DeleteOptions, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["gracePeriodSeconds"], "int32", "gracePeriodSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["orphanDependents"], "bool", "orphanDependents"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["propagationPolicy"], "string", "propagationPolicy"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["gracePeriodSeconds"].(int32); localVarOk {
localVarQueryParams.Add("gracePeriodSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["orphanDependents"].(bool); localVarOk {
localVarQueryParams.Add("orphanDependents", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["propagationPolicy"].(string); localVarOk {
localVarQueryParams.Add("propagationPolicy", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
delete collection of APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1Status*/
func (a *ApiregistrationV1beta1ApiService) DeleteCollectionAPIService(ctx context.Context, localVarOptionals map[string]interface{}) (V1Status, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Delete")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1Status
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *ApiregistrationV1beta1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
list or watch objects of kind APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "continue_" (string) The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server the server will respond with a 410 ResourceExpired error indicating the client must restart their list without the continue field. This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
@param "fieldSelector" (string) A selector to restrict the list of returned objects by their fields. Defaults to everything.
@param "includeUninitialized" (bool) If true, partially initialized resources are included in the response.
@param "labelSelector" (string) A selector to restrict the list of returned objects by their labels. Defaults to everything.
@param "limit" (int32) limit is a maximum number of responses to return for a list call. If more items exist, the server will set the &#x60;continue&#x60; field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
@param "resourceVersion" (string) When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it&#39;s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
@param "timeoutSeconds" (int32) Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
@param "watch" (bool) Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
@return V1beta1ApiServiceList*/
func (a *ApiregistrationV1beta1ApiService) ListAPIService(ctx context.Context, localVarOptionals map[string]interface{}) (V1beta1ApiServiceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1ApiServiceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["continue_"], "string", "continue_"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["fieldSelector"], "string", "fieldSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["includeUninitialized"], "bool", "includeUninitialized"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["labelSelector"], "string", "labelSelector"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["resourceVersion"], "string", "resourceVersion"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["timeoutSeconds"], "int32", "timeoutSeconds"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["watch"], "bool", "watch"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["continue_"].(string); localVarOk {
localVarQueryParams.Add("continue", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["fieldSelector"].(string); localVarOk {
localVarQueryParams.Add("fieldSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["includeUninitialized"].(bool); localVarOk {
localVarQueryParams.Add("includeUninitialized", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["labelSelector"].(string); localVarOk {
localVarQueryParams.Add("labelSelector", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk {
localVarQueryParams.Add("limit", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["resourceVersion"].(string); localVarOk {
localVarQueryParams.Add("resourceVersion", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["timeoutSeconds"].(int32); localVarOk {
localVarQueryParams.Add("timeoutSeconds", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["watch"].(bool); localVarOk {
localVarQueryParams.Add("watch", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
"application/json;stream=watch",
"application/vnd.kubernetes.protobuf;stream=watch",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
partially update the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1ApiService*/
func (a *ApiregistrationV1beta1ApiService) PatchAPIService(ctx context.Context, name string, body interface{}, localVarOptionals map[string]interface{}) (V1beta1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Patch")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json-patch+json", "application/merge-patch+json", "application/strategic-merge-patch+json", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
read the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@param "exact" (bool) Should the export be exact. Exact export maintains cluster-specific fields like &#39;Namespace&#39;.
@param "export" (bool) Should this value be exported. Export strips fields that a user can not specify.
@return V1beta1ApiService*/
func (a *ApiregistrationV1beta1ApiService) ReadAPIService(ctx context.Context, name string, localVarOptionals map[string]interface{}) (V1beta1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["exact"], "bool", "exact"); err != nil {
return successPayload, nil, err
}
if err := typeCheckParameter(localVarOptionals["export"], "bool", "export"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["exact"].(bool); localVarOk {
localVarQueryParams.Add("exact", parameterToString(localVarTempParam, ""))
}
if localVarTempParam, localVarOk := localVarOptionals["export"].(bool); localVarOk {
localVarQueryParams.Add("export", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
replace the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1ApiService*/
func (a *ApiregistrationV1beta1ApiService) ReplaceAPIService(ctx context.Context, name string, body V1beta1ApiService, localVarOptionals map[string]interface{}) (V1beta1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* ApiregistrationV1beta1ApiService
replace status of the specified APIService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param name name of the APIService
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1ApiService*/
func (a *ApiregistrationV1beta1ApiService) ReplaceAPIServiceStatus(ctx context.Context, name string, body V1beta1ApiService, localVarOptionals map[string]interface{}) (V1beta1ApiService, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Put")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1ApiService
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}/status"
localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// ServiceReference holds a reference to Service.legacy.k8s.io
type ApiregistrationV1beta1ServiceReference struct {
// Name is the name of the service
Name string `json:"name,omitempty"`
// Namespace is the namespace of the service
Namespace string `json:"namespace,omitempty"`
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type ApisApiService service
/* ApisApiService
get available API versions
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroupList*/
func (a *ApisApiService) GetAPIVersions(ctx context.Context) (V1ApiGroupList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroupList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type AppsApiService service
/* AppsApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *AppsApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/apps/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets.
type AppsV1beta1Deployment struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard object metadata.
Metadata *V1ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the Deployment.
Spec *AppsV1beta1DeploymentSpec `json:"spec,omitempty"`
// Most recently observed status of the Deployment.
Status *AppsV1beta1DeploymentStatus `json:"status,omitempty"`
}

View File

@ -0,0 +1,36 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"time"
)
// DeploymentCondition describes the state of a deployment at a certain point.
type AppsV1beta1DeploymentCondition struct {
// Last time the condition transitioned from one status to another.
LastTransitionTime time.Time `json:"lastTransitionTime,omitempty"`
// The last time this condition was updated.
LastUpdateTime time.Time `json:"lastUpdateTime,omitempty"`
// A human readable message indicating details about the transition.
Message string `json:"message,omitempty"`
// The reason for the condition's last transition.
Reason string `json:"reason,omitempty"`
// Status of the condition, one of True, False, Unknown.
Status string `json:"status"`
// Type of deployment condition.
Type_ string `json:"type"`
}

View File

@ -0,0 +1,26 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentList is a list of Deployments.
type AppsV1beta1DeploymentList struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Items is the list of Deployments.
Items []AppsV1beta1Deployment `json:"items"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard list metadata.
Metadata *V1ListMeta `json:"metadata,omitempty"`
}

View File

@ -0,0 +1,29 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DEPRECATED. DeploymentRollback stores the information required to rollback a deployment.
type AppsV1beta1DeploymentRollback struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Required: This must match the Name of a deployment.
Name string `json:"name"`
// The config of this deployment rollback.
RollbackTo *AppsV1beta1RollbackConfig `json:"rollbackTo"`
// The annotations to be updated to a deployment
UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty"`
}

View File

@ -0,0 +1,41 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentSpec is the specification of the desired behavior of the Deployment.
type AppsV1beta1DeploymentSpec struct {
// Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
// Indicates that the deployment is paused.
Paused bool `json:"paused,omitempty"`
// The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.
ProgressDeadlineSeconds int32 `json:"progressDeadlineSeconds,omitempty"`
// Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
Replicas int32 `json:"replicas,omitempty"`
// The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 2.
RevisionHistoryLimit int32 `json:"revisionHistoryLimit,omitempty"`
// DEPRECATED. The config this deployment is rolling back to. Will be cleared after rollback is done.
RollbackTo *AppsV1beta1RollbackConfig `json:"rollbackTo,omitempty"`
// Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.
Selector *V1LabelSelector `json:"selector,omitempty"`
// The deployment strategy to use to replace existing pods with new ones.
Strategy *AppsV1beta1DeploymentStrategy `json:"strategy,omitempty"`
// Template describes the pods that will be created.
Template *V1PodTemplateSpec `json:"template"`
}

View File

@ -0,0 +1,38 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentStatus is the most recently observed status of the Deployment.
type AppsV1beta1DeploymentStatus struct {
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
AvailableReplicas int32 `json:"availableReplicas,omitempty"`
// Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.
CollisionCount int32 `json:"collisionCount,omitempty"`
// Represents the latest available observations of a deployment's current state.
Conditions []AppsV1beta1DeploymentCondition `json:"conditions,omitempty"`
// The generation observed by the deployment controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Total number of ready pods targeted by this deployment.
ReadyReplicas int32 `json:"readyReplicas,omitempty"`
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
Replicas int32 `json:"replicas,omitempty"`
// Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentStrategy describes how to replace existing pods with new ones.
type AppsV1beta1DeploymentStrategy struct {
// Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate.
RollingUpdate *AppsV1beta1RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
// Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate.
Type_ string `json:"type,omitempty"`
}

View File

@ -0,0 +1,17 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DEPRECATED.
type AppsV1beta1RollbackConfig struct {
// The revision to rollback to. If set to 0, rollback to the last revision.
Revision int64 `json:"revision,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Spec to control the desired behavior of rolling update.
type AppsV1beta1RollingUpdateDeployment struct {
// The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. Defaults to 25%. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods.
MaxSurge *interface{} `json:"maxSurge,omitempty"`
// The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. Defaults to 25%. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.
MaxUnavailable *interface{} `json:"maxUnavailable,omitempty"`
}

View File

@ -0,0 +1,29 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Scale represents a scaling request for a resource.
type AppsV1beta1Scale struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
Metadata *V1ObjectMeta `json:"metadata,omitempty"`
// defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
Spec *AppsV1beta1ScaleSpec `json:"spec,omitempty"`
// current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.
Status *AppsV1beta1ScaleStatus `json:"status,omitempty"`
}

View File

@ -0,0 +1,17 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// ScaleSpec describes the attributes of a scale subresource
type AppsV1beta1ScaleSpec struct {
// desired number of instances for the scaled object.
Replicas int32 `json:"replicas,omitempty"`
}

View File

@ -0,0 +1,23 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// ScaleStatus represents the current status of a scale subresource.
type AppsV1beta1ScaleStatus struct {
// actual number of observed instances of the scaled object.
Replicas int32 `json:"replicas"`
// label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
Selector map[string]string `json:"selector,omitempty"`
// label selector for pods that should match the replicas count. This is a serializated version of both map-based and more expressive set-based selectors. This is done to avoid introspection in the clients. The string will be in the same format as the query-param syntax. If the target type only supports map-based selectors, both this field and map-based selector field are populated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
TargetSelector string `json:"targetSelector,omitempty"`
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type AuthenticationApiService service
/* AuthenticationApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *AuthenticationApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authentication.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,193 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type AuthenticationV1ApiService service
/* AuthenticationV1ApiService
create a TokenReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1TokenReview*/
func (a *AuthenticationV1ApiService) CreateTokenReview(ctx context.Context, body V1TokenReview, localVarOptionals map[string]interface{}) (V1TokenReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1TokenReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authentication.k8s.io/v1/tokenreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthenticationV1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *AuthenticationV1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authentication.k8s.io/v1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,193 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type AuthenticationV1beta1ApiService service
/* AuthenticationV1beta1ApiService
create a TokenReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1TokenReview*/
func (a *AuthenticationV1beta1ApiService) CreateTokenReview(ctx context.Context, body V1beta1TokenReview, localVarOptionals map[string]interface{}) (V1beta1TokenReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1TokenReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authentication.k8s.io/v1beta1/tokenreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthenticationV1beta1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *AuthenticationV1beta1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authentication.k8s.io/v1beta1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type AuthorizationApiService service
/* AuthorizationApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *AuthorizationApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,460 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type AuthorizationV1ApiService service
/* AuthorizationV1ApiService
create a LocalSubjectAccessReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param namespace object name and auth scope, such as for teams and projects
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1LocalSubjectAccessReview*/
func (a *AuthorizationV1ApiService) CreateNamespacedLocalSubjectAccessReview(ctx context.Context, namespace string, body V1LocalSubjectAccessReview, localVarOptionals map[string]interface{}) (V1LocalSubjectAccessReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1LocalSubjectAccessReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews"
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1ApiService
create a SelfSubjectAccessReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1SelfSubjectAccessReview*/
func (a *AuthorizationV1ApiService) CreateSelfSubjectAccessReview(ctx context.Context, body V1SelfSubjectAccessReview, localVarOptionals map[string]interface{}) (V1SelfSubjectAccessReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1SelfSubjectAccessReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1ApiService
create a SelfSubjectRulesReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1SelfSubjectRulesReview*/
func (a *AuthorizationV1ApiService) CreateSelfSubjectRulesReview(ctx context.Context, body V1SelfSubjectRulesReview, localVarOptionals map[string]interface{}) (V1SelfSubjectRulesReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1SelfSubjectRulesReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1ApiService
create a SubjectAccessReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1SubjectAccessReview*/
func (a *AuthorizationV1ApiService) CreateSubjectAccessReview(ctx context.Context, body V1SubjectAccessReview, localVarOptionals map[string]interface{}) (V1SubjectAccessReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1SubjectAccessReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1/subjectaccessreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *AuthorizationV1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,460 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
// Linger please
var (
_ context.Context
)
type AuthorizationV1beta1ApiService service
/* AuthorizationV1beta1ApiService
create a LocalSubjectAccessReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param namespace object name and auth scope, such as for teams and projects
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1LocalSubjectAccessReview*/
func (a *AuthorizationV1beta1ApiService) CreateNamespacedLocalSubjectAccessReview(ctx context.Context, namespace string, body V1beta1LocalSubjectAccessReview, localVarOptionals map[string]interface{}) (V1beta1LocalSubjectAccessReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1LocalSubjectAccessReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews"
localVarPath = strings.Replace(localVarPath, "{"+"namespace"+"}", fmt.Sprintf("%v", namespace), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1beta1ApiService
create a SelfSubjectAccessReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1SelfSubjectAccessReview*/
func (a *AuthorizationV1beta1ApiService) CreateSelfSubjectAccessReview(ctx context.Context, body V1beta1SelfSubjectAccessReview, localVarOptionals map[string]interface{}) (V1beta1SelfSubjectAccessReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1SelfSubjectAccessReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1beta1ApiService
create a SelfSubjectRulesReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1SelfSubjectRulesReview*/
func (a *AuthorizationV1beta1ApiService) CreateSelfSubjectRulesReview(ctx context.Context, body V1beta1SelfSubjectRulesReview, localVarOptionals map[string]interface{}) (V1beta1SelfSubjectRulesReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1SelfSubjectRulesReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1beta1ApiService
create a SubjectAccessReview
* @param ctx context.Context for authentication, logging, tracing, etc.
@param body
@param optional (nil or map[string]interface{}) with one or more of:
@param "pretty" (string) If &#39;true&#39;, then the output is pretty printed.
@return V1beta1SubjectAccessReview*/
func (a *AuthorizationV1beta1ApiService) CreateSubjectAccessReview(ctx context.Context, body V1beta1SubjectAccessReview, localVarOptionals map[string]interface{}) (V1beta1SubjectAccessReview, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1beta1SubjectAccessReview
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if err := typeCheckParameter(localVarOptionals["pretty"], "string", "pretty"); err != nil {
return successPayload, nil, err
}
if localVarTempParam, localVarOk := localVarOptionals["pretty"].(string); localVarOk {
localVarQueryParams.Add("pretty", parameterToString(localVarTempParam, ""))
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "*/*", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}
/* AuthorizationV1beta1ApiService
get available resources
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiResourceList*/
func (a *AuthorizationV1beta1ApiService) GetAPIResources(ctx context.Context) (V1ApiResourceList, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiResourceList
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/authorization.k8s.io/v1beta1/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type AutoscalingApiService service
/* AutoscalingApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *AutoscalingApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/autoscaling/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type BatchApiService service
/* BatchApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *BatchApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/batch/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,187 @@
package client
import (
"log"
"time"
)
type objEntry struct {
metadata *V1ObjectMeta
obj interface{}
}
// ObjectLister is a function that knows how to list objects.
type ObjectLister func() ([]interface{}, string, error)
// ObjectWatcher is a function that knows how to perform a watch.
type ObjectWatcher func(resourceVersion string) (results <-chan *Result, errors <-chan error)
// EventHandler is implemented by objects that want event notifications
type EventHandler interface {
OnAdd(obj interface{})
OnUpdate(oldObj, newObj interface{})
OnDelete(obj interface{})
}
// Informer is an interface for things that can provide notifications
type Informer interface {
AddEventHandler(handler EventHandler)
}
// Lister is an interface for things that can list objects for all namespaces or by namespace
type Lister interface {
List() []interface{}
ByNamespace(namespace string) []interface{}
}
// Validate that we implement the interfaces
var _ Lister = &Cache{}
var _ Informer = &Cache{}
// Cache is an implementation of a List/Watch cache
type Cache struct {
Extractor func(interface{}) *V1ObjectMeta
Lister ObjectLister
Watcher ObjectWatcher
allObjects []objEntry
namespaceObjects map[string][]objEntry
eventHandlers []EventHandler
}
func (c *Cache) AddEventHandler(handler EventHandler) {
c.eventHandlers = append(c.eventHandlers, handler)
}
const maxSleep = 60 * time.Second
func (c *Cache) Run(stop <-chan bool) {
sleep := 1 * time.Second
for {
select {
case <-stop:
return
default:
// pass
}
if err := c.ListWatch(); err != nil {
log.Printf("%s\n", err.Error())
time.Sleep(sleep)
sleep = sleep * 2
if sleep > maxSleep {
sleep = maxSleep
}
} else {
sleep = 1
}
}
}
func (c *Cache) ListWatch() error {
objects, resourceVersion, err := c.Lister()
if err != nil {
return err
}
for ix := range objects {
meta := c.Extractor(objects[ix])
c.AddOrUpdate(meta, objects[ix])
}
results, errors := c.Watcher(resourceVersion)
for {
select {
case result, ok := <-results:
if !ok {
return nil
}
c.ProcessResult(result)
case err := <-errors:
return err
}
}
}
func (c *Cache) ProcessResult(res *Result) {
metadata := c.Extractor(res.Object)
switch res.Type {
case Added, Modified:
c.AddOrUpdate(metadata, res.Object)
case Deleted:
c.Delete(metadata, res.Object)
}
}
func (c *Cache) AddOrUpdate(metadata *V1ObjectMeta, obj interface{}) {
var oldObj interface{}
c.allObjects, oldObj = InsertOrUpdate(c.allObjects, metadata, obj)
if len(metadata.Namespace) > 0 {
c.namespaceObjects[metadata.Namespace], _ =
InsertOrUpdate(c.namespaceObjects[metadata.Namespace], metadata, obj)
}
for ix := range c.eventHandlers {
if oldObj == nil {
c.eventHandlers[ix].OnAdd(obj)
} else {
c.eventHandlers[ix].OnUpdate(oldObj, obj)
}
}
}
func (c *Cache) Delete(metadata *V1ObjectMeta, obj interface{}) {
var deleted bool
c.allObjects, deleted = Delete(c.allObjects, metadata)
if len(metadata.Namespace) > 0 {
c.namespaceObjects[metadata.Namespace], _ =
Delete(c.namespaceObjects[metadata.Namespace], metadata)
}
if deleted {
for ix := range c.eventHandlers {
c.eventHandlers[ix].OnDelete(obj)
}
}
}
func (c *Cache) List() []interface{} {
result := make([]interface{}, len(c.allObjects))
for ix := range c.allObjects {
result[ix] = c.allObjects[ix].obj
}
return result
}
func (c *Cache) ByNamespace(namespace string) []interface{} {
list := c.namespaceObjects[namespace]
result := make([]interface{}, len(list))
for ix := range list {
result[ix] = list[ix].obj
}
return result
}
func InsertOrUpdate(list []objEntry, metadata *V1ObjectMeta, obj interface{}) ([]objEntry, interface{}) {
ix := FindObject(list, metadata)
if ix == -1 {
return append(list, objEntry{metadata: metadata, obj: obj}), nil
}
oldObj := list[ix]
list[ix] = objEntry{metadata: metadata, obj: obj}
return list, oldObj
}
func Delete(list []objEntry, metadata *V1ObjectMeta) ([]objEntry, bool) {
ix := FindObject(list, metadata)
if ix == -1 {
return list, false
}
return append(list[:ix], list[ix+1:]...), true
}
func FindObject(list []objEntry, metadata *V1ObjectMeta) int {
for ix := range list {
entry := &list[ix]
if entry.metadata.Namespace == metadata.Namespace &&
entry.metadata.Name == metadata.Name {
return ix
}
}
return -1
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type CertificatesApiService service
/* CertificatesApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *CertificatesApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/certificates.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,72 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"net/http"
)
// contextKeys are used to identify the type of value in the context.
// Since these are string, it is possible to get a short description of the
// context key for logging and debugging using key.String().
type contextKey string
func (c contextKey) String() string {
return "auth " + string(c)
}
var (
// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
ContextOAuth2 = contextKey("token")
// ContextBasicAuth takes BasicAuth as authentication for the request.
ContextBasicAuth = contextKey("basic")
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextAPIKey takes an APIKey as authentication for the request
ContextAPIKey = contextKey("apikey")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKey struct {
Key string
Prefix string
}
type Configuration struct {
BasePath string `json:"basePath,omitempty"`
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
HTTPClient *http.Client
}
func NewConfiguration() *Configuration {
cfg := &Configuration{
BasePath: "https://localhost",
DefaultHeader: make(map[string]string),
UserAgent: "Swagger-Codegen/0.1.0a1/go",
}
return cfg
}
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type CoreApiService service
/* CoreApiService
get available API versions
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiVersions*/
func (a *CoreApiService) GetAPIVersions(ctx context.Context) (V1ApiVersions, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiVersions
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/api/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type EventsApiService service
/* EventsApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *EventsApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/events.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type ExtensionsApiService service
/* ExtensionsApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *ExtensionsApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/extensions/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,17 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// AllowedFlexVolume represents a single Flexvolume that is allowed to be used.
type ExtensionsV1beta1AllowedFlexVolume struct {
// Driver is the name of the Flexvolume driver.
Driver string `json:"driver"`
}

View File

@ -0,0 +1,17 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.
type ExtensionsV1beta1AllowedHostPath struct {
// is the path prefix that the host volume must match. It does not support `*`. Trailing slashes are trimmed when validating the path prefix with a host path. Examples: `/foo` would allow `/foo`, `/foo/` and `/foo/bar` `/foo` would not allow `/food` or `/etc/foo`
PathPrefix string `json:"pathPrefix,omitempty"`
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DEPRECATED - This group version of Deployment is deprecated by apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets.
type ExtensionsV1beta1Deployment struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard object metadata.
Metadata *V1ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the Deployment.
Spec *ExtensionsV1beta1DeploymentSpec `json:"spec,omitempty"`
// Most recently observed status of the Deployment.
Status *ExtensionsV1beta1DeploymentStatus `json:"status,omitempty"`
}

View File

@ -0,0 +1,36 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"time"
)
// DeploymentCondition describes the state of a deployment at a certain point.
type ExtensionsV1beta1DeploymentCondition struct {
// Last time the condition transitioned from one status to another.
LastTransitionTime time.Time `json:"lastTransitionTime,omitempty"`
// The last time this condition was updated.
LastUpdateTime time.Time `json:"lastUpdateTime,omitempty"`
// A human readable message indicating details about the transition.
Message string `json:"message,omitempty"`
// The reason for the condition's last transition.
Reason string `json:"reason,omitempty"`
// Status of the condition, one of True, False, Unknown.
Status string `json:"status"`
// Type of deployment condition.
Type_ string `json:"type"`
}

View File

@ -0,0 +1,26 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentList is a list of Deployments.
type ExtensionsV1beta1DeploymentList struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Items is the list of Deployments.
Items []ExtensionsV1beta1Deployment `json:"items"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard list metadata.
Metadata *V1ListMeta `json:"metadata,omitempty"`
}

View File

@ -0,0 +1,29 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DEPRECATED. DeploymentRollback stores the information required to rollback a deployment.
type ExtensionsV1beta1DeploymentRollback struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Required: This must match the Name of a deployment.
Name string `json:"name"`
// The config of this deployment rollback.
RollbackTo *ExtensionsV1beta1RollbackConfig `json:"rollbackTo"`
// The annotations to be updated to a deployment
UpdatedAnnotations map[string]string `json:"updatedAnnotations,omitempty"`
}

View File

@ -0,0 +1,41 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentSpec is the specification of the desired behavior of the Deployment.
type ExtensionsV1beta1DeploymentSpec struct {
// Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)
MinReadySeconds int32 `json:"minReadySeconds,omitempty"`
// Indicates that the deployment is paused and will not be processed by the deployment controller.
Paused bool `json:"paused,omitempty"`
// The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. This is not set by default.
ProgressDeadlineSeconds int32 `json:"progressDeadlineSeconds,omitempty"`
// Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.
Replicas int32 `json:"replicas,omitempty"`
// The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified.
RevisionHistoryLimit int32 `json:"revisionHistoryLimit,omitempty"`
// DEPRECATED. The config this deployment is rolling back to. Will be cleared after rollback is done.
RollbackTo *ExtensionsV1beta1RollbackConfig `json:"rollbackTo,omitempty"`
// Label selector for pods. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment.
Selector *V1LabelSelector `json:"selector,omitempty"`
// The deployment strategy to use to replace existing pods with new ones.
Strategy *ExtensionsV1beta1DeploymentStrategy `json:"strategy,omitempty"`
// Template describes the pods that will be created.
Template *V1PodTemplateSpec `json:"template"`
}

View File

@ -0,0 +1,38 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentStatus is the most recently observed status of the Deployment.
type ExtensionsV1beta1DeploymentStatus struct {
// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
AvailableReplicas int32 `json:"availableReplicas,omitempty"`
// Count of hash collisions for the Deployment. The Deployment controller uses this field as a collision avoidance mechanism when it needs to create the name for the newest ReplicaSet.
CollisionCount int32 `json:"collisionCount,omitempty"`
// Represents the latest available observations of a deployment's current state.
Conditions []ExtensionsV1beta1DeploymentCondition `json:"conditions,omitempty"`
// The generation observed by the deployment controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// Total number of ready pods targeted by this deployment.
ReadyReplicas int32 `json:"readyReplicas,omitempty"`
// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
Replicas int32 `json:"replicas,omitempty"`
// Total number of unavailable pods targeted by this deployment. This is the total number of pods that are still required for the deployment to have 100% available capacity. They may either be pods that are running but not yet available or pods that still have not been created.
UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`
// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DeploymentStrategy describes how to replace existing pods with new ones.
type ExtensionsV1beta1DeploymentStrategy struct {
// Rolling update config params. Present only if DeploymentStrategyType = RollingUpdate.
RollingUpdate *ExtensionsV1beta1RollingUpdateDeployment `json:"rollingUpdate,omitempty"`
// Type of deployment. Can be \"Recreate\" or \"RollingUpdate\". Default is RollingUpdate.
Type_ string `json:"type,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// FSGroupStrategyOptions defines the strategy type and options used to create the strategy.
type ExtensionsV1beta1FsGroupStrategyOptions struct {
// Ranges are the allowed ranges of fs groups. If you would like to force a single fs group then supply a single range with the same start and end.
Ranges []ExtensionsV1beta1IdRange `json:"ranges,omitempty"`
// Rule is the strategy that will dictate what FSGroup is used in the SecurityContext.
Rule string `json:"rule,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Host Port Range defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.
type ExtensionsV1beta1HostPortRange struct {
// max is the end of the range, inclusive.
Max int32 `json:"max"`
// min is the start of the range, inclusive.
Min int32 `json:"min"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// ID Range provides a min/max of an allowed range of IDs.
type ExtensionsV1beta1IdRange struct {
// Max is the end of the range, inclusive.
Max int64 `json:"max"`
// Min is the start of the range, inclusive.
Min int64 `json:"min"`
}

View File

@ -0,0 +1,26 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container.
type ExtensionsV1beta1PodSecurityPolicy struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
Metadata *V1ObjectMeta `json:"metadata,omitempty"`
// spec defines the policy enforced.
Spec *ExtensionsV1beta1PodSecurityPolicySpec `json:"spec,omitempty"`
}

View File

@ -0,0 +1,26 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Pod Security Policy List is a list of PodSecurityPolicy objects.
type ExtensionsV1beta1PodSecurityPolicyList struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Items is a list of schema objects.
Items []ExtensionsV1beta1PodSecurityPolicy `json:"items"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
Metadata *V1ListMeta `json:"metadata,omitempty"`
}

View File

@ -0,0 +1,68 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Pod Security Policy Spec defines the policy enforced.
type ExtensionsV1beta1PodSecurityPolicySpec struct {
// AllowPrivilegeEscalation determines if a pod can request to allow privilege escalation. If unspecified, defaults to true.
AllowPrivilegeEscalation bool `json:"allowPrivilegeEscalation,omitempty"`
// AllowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field may be added at the pod author's discretion. You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities.
AllowedCapabilities []string `json:"allowedCapabilities,omitempty"`
// AllowedFlexVolumes is a whitelist of allowed Flexvolumes. Empty or nil indicates that all Flexvolumes may be used. This parameter is effective only when the usage of the Flexvolumes is allowed in the \"Volumes\" field.
AllowedFlexVolumes []ExtensionsV1beta1AllowedFlexVolume `json:"allowedFlexVolumes,omitempty"`
// is a white list of allowed host paths. Empty indicates that all host paths may be used.
AllowedHostPaths []ExtensionsV1beta1AllowedHostPath `json:"allowedHostPaths,omitempty"`
// DefaultAddCapabilities is the default set of capabilities that will be added to the container unless the pod spec specifically drops the capability. You may not list a capability in both DefaultAddCapabilities and RequiredDropCapabilities. Capabilities added here are implicitly allowed, and need not be included in the AllowedCapabilities list.
DefaultAddCapabilities []string `json:"defaultAddCapabilities,omitempty"`
// DefaultAllowPrivilegeEscalation controls the default setting for whether a process can gain more privileges than its parent process.
DefaultAllowPrivilegeEscalation bool `json:"defaultAllowPrivilegeEscalation,omitempty"`
// FSGroup is the strategy that will dictate what fs group is used by the SecurityContext.
FsGroup *ExtensionsV1beta1FsGroupStrategyOptions `json:"fsGroup"`
// hostIPC determines if the policy allows the use of HostIPC in the pod spec.
HostIPC bool `json:"hostIPC,omitempty"`
// hostNetwork determines if the policy allows the use of HostNetwork in the pod spec.
HostNetwork bool `json:"hostNetwork,omitempty"`
// hostPID determines if the policy allows the use of HostPID in the pod spec.
HostPID bool `json:"hostPID,omitempty"`
// hostPorts determines which host port ranges are allowed to be exposed.
HostPorts []ExtensionsV1beta1HostPortRange `json:"hostPorts,omitempty"`
// privileged determines if a pod can request to be run as privileged.
Privileged bool `json:"privileged,omitempty"`
// ReadOnlyRootFilesystem when set to true will force containers to run with a read only root file system. If the container specifically requests to run with a non-read only root file system the PSP should deny the pod. If set to false the container may run with a read only root file system if it wishes but it will not be forced to.
ReadOnlyRootFilesystem bool `json:"readOnlyRootFilesystem,omitempty"`
// RequiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added.
RequiredDropCapabilities []string `json:"requiredDropCapabilities,omitempty"`
// runAsUser is the strategy that will dictate the allowable RunAsUser values that may be set.
RunAsUser *ExtensionsV1beta1RunAsUserStrategyOptions `json:"runAsUser"`
// seLinux is the strategy that will dictate the allowable labels that may be set.
SeLinux *ExtensionsV1beta1SeLinuxStrategyOptions `json:"seLinux"`
// SupplementalGroups is the strategy that will dictate what supplemental groups are used by the SecurityContext.
SupplementalGroups *ExtensionsV1beta1SupplementalGroupsStrategyOptions `json:"supplementalGroups"`
// volumes is a white list of allowed volume plugins. Empty indicates that all plugins may be used.
Volumes []string `json:"volumes,omitempty"`
}

View File

@ -0,0 +1,17 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// DEPRECATED.
type ExtensionsV1beta1RollbackConfig struct {
// The revision to rollback to. If set to 0, rollback to the last revision.
Revision int64 `json:"revision,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Spec to control the desired behavior of rolling update.
type ExtensionsV1beta1RollingUpdateDeployment struct {
// The maximum number of pods that can be scheduled above the desired number of pods. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up. By default, a value of 1 is used. Example: when this is set to 30%, the new RC can be scaled up immediately when the rolling update starts, such that the total number of old and new pods do not exceed 130% of desired pods. Once old pods have been killed, new RC can be scaled up further, ensuring that total number of pods running at any time during the update is atmost 130% of desired pods.
MaxSurge *interface{} `json:"maxSurge,omitempty"`
// The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. This can not be 0 if MaxSurge is 0. By default, a fixed value of 1 is used. Example: when this is set to 30%, the old RC can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old RC can be scaled down further, followed by scaling up the new RC, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.
MaxUnavailable *interface{} `json:"maxUnavailable,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// Run A sUser Strategy Options defines the strategy type and any options used to create the strategy.
type ExtensionsV1beta1RunAsUserStrategyOptions struct {
// Ranges are the allowed ranges of uids that may be used.
Ranges []ExtensionsV1beta1IdRange `json:"ranges,omitempty"`
// Rule is the strategy that will dictate the allowable RunAsUser values that may be set.
Rule string `json:"rule"`
}

View File

@ -0,0 +1,29 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// represents a scaling request for a resource.
type ExtensionsV1beta1Scale struct {
// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
ApiVersion string `json:"apiVersion,omitempty"`
// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
Metadata *V1ObjectMeta `json:"metadata,omitempty"`
// defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
Spec *ExtensionsV1beta1ScaleSpec `json:"spec,omitempty"`
// current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.
Status *ExtensionsV1beta1ScaleStatus `json:"status,omitempty"`
}

View File

@ -0,0 +1,17 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// describes the attributes of a scale subresource
type ExtensionsV1beta1ScaleSpec struct {
// desired number of instances for the scaled object.
Replicas int32 `json:"replicas,omitempty"`
}

View File

@ -0,0 +1,23 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// represents the current status of a scale subresource.
type ExtensionsV1beta1ScaleStatus struct {
// actual number of observed instances of the scaled object.
Replicas int32 `json:"replicas"`
// label query over pods that should match the replicas count. More info: http://kubernetes.io/docs/user-guide/labels#label-selectors
Selector map[string]string `json:"selector,omitempty"`
// label selector for pods that should match the replicas count. This is a serializated version of both map-based and more expressive set-based selectors. This is done to avoid introspection in the clients. The string will be in the same format as the query-param syntax. If the target type only supports map-based selectors, both this field and map-based selector field are populated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
TargetSelector string `json:"targetSelector,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// SELinux Strategy Options defines the strategy type and any options used to create the strategy.
type ExtensionsV1beta1SeLinuxStrategyOptions struct {
// type is the strategy that will dictate the allowable labels that may be set.
Rule string `json:"rule"`
// seLinuxOptions required to run as; required for MustRunAs More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
SeLinuxOptions *V1SeLinuxOptions `json:"seLinuxOptions,omitempty"`
}

View File

@ -0,0 +1,20 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.
type ExtensionsV1beta1SupplementalGroupsStrategyOptions struct {
// Ranges are the allowed ranges of supplemental groups. If you would like to force a single supplemental group then supply a single range with the same start and end.
Ranges []ExtensionsV1beta1IdRange `json:"ranges,omitempty"`
// Rule is the strategy that will dictate what supplemental groups is used in the SecurityContext.
Rule string `json:"rule,omitempty"`
}

View File

@ -0,0 +1,52 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="kubernetes-client"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="go"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -0,0 +1,164 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"fmt"
)
// Linger please
var (
_ context.Context
)
type LogsApiService service
/* LogsApiService
* @param ctx context.Context for authentication, logging, tracing, etc.
@param logpath path to the log
@return */
func (a *LogsApiService) LogFileHandler(ctx context.Context, logpath string) ( *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/logs/{logpath}"
localVarPath = strings.Replace(localVarPath, "{"+"logpath"+"}", fmt.Sprintf("%v", logpath), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
return localVarHttpResponse, err
}
/* LogsApiService
* @param ctx context.Context for authentication, logging, tracing, etc.
@return */
func (a *LogsApiService) LogFileListHandler(ctx context.Context) ( *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/logs/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
return localVarHttpResponse, err
}

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type NetworkingApiService service
/* NetworkingApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *NetworkingApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/networking.k8s.io/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
import (
"io/ioutil"
"net/url"
"net/http"
"strings"
"golang.org/x/net/context"
"encoding/json"
)
// Linger please
var (
_ context.Context
)
type PolicyApiService service
/* PolicyApiService
get information of a group
* @param ctx context.Context for authentication, logging, tracing, etc.
@return V1ApiGroup*/
func (a *PolicyApiService) GetAPIGroup(ctx context.Context) (V1ApiGroup, *http.Response, error) {
var (
localVarHttpMethod = strings.ToUpper("Get")
localVarPostBody interface{}
localVarFileName string
localVarFileBytes []byte
successPayload V1ApiGroup
)
// create path and map variables
localVarPath := a.client.cfg.BasePath + "/apis/policy/"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", "application/yaml", "application/vnd.kubernetes.protobuf", }
// set Content-Type header
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf",
}
// set Accept header
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
if ctx != nil {
// API Key Authentication
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
var key string
if auth.Prefix != "" {
key = auth.Prefix + " " + auth.Key
} else {
key = auth.Key
}
localVarHeaderParams["authorization"] = key
}
}
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, nil, err
}
localVarHttpResponse, err := a.client.callAPI(r)
if err != nil || localVarHttpResponse == nil {
return successPayload, localVarHttpResponse, err
}
defer localVarHttpResponse.Body.Close()
if localVarHttpResponse.StatusCode >= 300 {
bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)
return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes)
}
if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {
return successPayload, localVarHttpResponse, err
}
return successPayload, localVarHttpResponse, err
}

View File

@ -0,0 +1,17 @@
/*
* Kubernetes
*
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* API version: v1.10.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package client
// AllowedFlexVolume represents a single Flexvolume that is allowed to be used.
type PolicyV1beta1AllowedFlexVolume struct {
// Driver is the name of the Flexvolume driver.
Driver string `json:"driver"`
}

Some files were not shown because too many files have changed in this diff Show More