Merge pull request #34001 from mbohlool/h2o

Automatic merge from submit-queue

Generate and store federation OpenAPI spec in source tree

A follow up of #33628 to also add federation spec to source tree.
This commit is contained in:
Kubernetes Submit Queue 2016-10-08 17:46:51 -07:00 committed by GitHub
commit 0603af42c6
11 changed files with 14915 additions and 0 deletions

View File

@ -0,0 +1,78 @@
{
"swagger": "2.0",
"info": {
"title": "Generic API Server /api",
"version": "unversioned"
},
"paths": {
"/api/": {
"get": {
"description": "get available API versions",
"consumes": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"operationId": "getAPIVersions",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/unversioned.APIVersions"
}
}
}
}
}
},
"definitions": {
"unversioned.APIVersions": {
"description": "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.",
"required": [
"versions",
"serverAddressByClientCIDRs"
],
"properties": {
"serverAddressByClientCIDRs": {
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.ServerAddressByClientCIDR"
}
},
"versions": {
"description": "versions are the api versions that are available.",
"type": "array",
"items": {
"type": "string"
}
}
}
},
"unversioned.ServerAddressByClientCIDR": {
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
"required": [
"clientCIDR",
"serverAddress"
],
"properties": {
"clientCIDR": {
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use.",
"type": "string"
},
"serverAddress": {
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.",
"type": "string"
}
}
}
}
}

View File

@ -0,0 +1,119 @@
{
"swagger": "2.0",
"info": {
"title": "Generic API Server /apis",
"version": "unversioned"
},
"paths": {
"/apis/": {
"get": {
"description": "get available API versions",
"consumes": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"operationId": "getAPIVersions",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/unversioned.APIGroupList"
}
}
}
}
}
},
"definitions": {
"unversioned.APIGroup": {
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
"required": [
"name",
"versions",
"serverAddressByClientCIDRs"
],
"properties": {
"name": {
"description": "name is the name of the group.",
"type": "string"
},
"preferredVersion": {
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version.",
"$ref": "#/definitions/unversioned.GroupVersionForDiscovery"
},
"serverAddressByClientCIDRs": {
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.ServerAddressByClientCIDR"
}
},
"versions": {
"description": "versions are the versions supported in this group.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.GroupVersionForDiscovery"
}
}
}
},
"unversioned.APIGroupList": {
"description": "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.",
"required": [
"groups"
],
"properties": {
"groups": {
"description": "groups is a list of APIGroup.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.APIGroup"
}
}
}
},
"unversioned.GroupVersionForDiscovery": {
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
"required": [
"groupVersion",
"version"
],
"properties": {
"groupVersion": {
"description": "groupVersion specifies the API group and version in the form \"group/version\"",
"type": "string"
},
"version": {
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
"type": "string"
}
}
},
"unversioned.ServerAddressByClientCIDR": {
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
"required": [
"clientCIDR",
"serverAddress"
],
"properties": {
"clientCIDR": {
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use.",
"type": "string"
},
"serverAddress": {
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.",
"type": "string"
}
}
}
}
}

View File

@ -0,0 +1,104 @@
{
"swagger": "2.0",
"info": {
"title": "Generic API Server /apis/extensions",
"version": "unversioned"
},
"paths": {
"/apis/extensions/": {
"get": {
"description": "get information of a group",
"consumes": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"operationId": "getAPIGroup",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/unversioned.APIGroup"
}
}
}
}
}
},
"definitions": {
"unversioned.APIGroup": {
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
"required": [
"name",
"versions",
"serverAddressByClientCIDRs"
],
"properties": {
"name": {
"description": "name is the name of the group.",
"type": "string"
},
"preferredVersion": {
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version.",
"$ref": "#/definitions/unversioned.GroupVersionForDiscovery"
},
"serverAddressByClientCIDRs": {
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.ServerAddressByClientCIDR"
}
},
"versions": {
"description": "versions are the versions supported in this group.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.GroupVersionForDiscovery"
}
}
}
},
"unversioned.GroupVersionForDiscovery": {
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
"required": [
"groupVersion",
"version"
],
"properties": {
"groupVersion": {
"description": "groupVersion specifies the API group and version in the form \"group/version\"",
"type": "string"
},
"version": {
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
"type": "string"
}
}
},
"unversioned.ServerAddressByClientCIDR": {
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
"required": [
"clientCIDR",
"serverAddress"
],
"properties": {
"clientCIDR": {
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use.",
"type": "string"
},
"serverAddress": {
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.",
"type": "string"
}
}
}
}
}

View File

@ -0,0 +1,104 @@
{
"swagger": "2.0",
"info": {
"title": "Generic API Server /apis/federation",
"version": "unversioned"
},
"paths": {
"/apis/federation/": {
"get": {
"description": "get information of a group",
"consumes": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"produces": [
"application/json",
"application/yaml",
"application/vnd.kubernetes.protobuf"
],
"schemes": [
"https"
],
"operationId": "getAPIGroup",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/unversioned.APIGroup"
}
}
}
}
}
},
"definitions": {
"unversioned.APIGroup": {
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
"required": [
"name",
"versions",
"serverAddressByClientCIDRs"
],
"properties": {
"name": {
"description": "name is the name of the group.",
"type": "string"
},
"preferredVersion": {
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version.",
"$ref": "#/definitions/unversioned.GroupVersionForDiscovery"
},
"serverAddressByClientCIDRs": {
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.ServerAddressByClientCIDR"
}
},
"versions": {
"description": "versions are the versions supported in this group.",
"type": "array",
"items": {
"$ref": "#/definitions/unversioned.GroupVersionForDiscovery"
}
}
}
},
"unversioned.GroupVersionForDiscovery": {
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
"required": [
"groupVersion",
"version"
],
"properties": {
"groupVersion": {
"description": "groupVersion specifies the API group and version in the form \"group/version\"",
"type": "string"
},
"version": {
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.",
"type": "string"
}
}
},
"unversioned.ServerAddressByClientCIDR": {
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
"required": [
"clientCIDR",
"serverAddress"
],
"properties": {
"clientCIDR": {
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use.",
"type": "string"
},
"serverAddress": {
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.",
"type": "string"
}
}
}
}
}

View File

@ -0,0 +1,46 @@
{
"swagger": "2.0",
"info": {
"title": "Generic API Server /logs",
"version": "unversioned"
},
"paths": {
"/logs/": {
"get": {
"schemes": [
"https"
],
"operationId": "logFileListHandler",
"responses": {
"default": {
"description": "Default Response."
}
}
}
},
"/logs/{logpath}": {
"get": {
"schemes": [
"https"
],
"operationId": "logFileHandler",
"responses": {
"default": {
"description": "Default Response."
}
}
},
"parameters": [
{
"uniqueItems": true,
"type": "string",
"description": "path to the log",
"name": "logpath",
"in": "path",
"required": true
}
]
}
},
"definitions": {}
}

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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
{
"swagger": "2.0",
"info": {
"title": "Generic API Server /version",
"version": "unversioned"
},
"paths": {
"/version/": {
"get": {
"description": "get the code version",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"https"
],
"operationId": "getCodeVersion",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/version.Info"
}
}
}
}
}
},
"definitions": {
"version.Info": {
"description": "Info contains versioning information. how we'll want to distribute that information.",
"required": [
"major",
"minor",
"gitVersion",
"gitCommit",
"gitTreeState",
"buildDate",
"goVersion",
"compiler",
"platform"
],
"properties": {
"buildDate": {
"type": "string"
},
"compiler": {
"type": "string"
},
"gitCommit": {
"type": "string"
},
"gitTreeState": {
"type": "string"
},
"gitVersion": {
"type": "string"
},
"goVersion": {
"type": "string"
},
"major": {
"type": "string"
},
"minor": {
"type": "string"
},
"platform": {
"type": "string"
}
}
}
}
}

View File

@ -0,0 +1,74 @@
#!/bin/bash
# Copyright 2015 The Kubernetes Authors.
#
# 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.
# Script to fetch latest openapi spec from federation-apiserver
# Puts the updated spec at federation/apis/openapi-spec/
set -o errexit
set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
OPENAPI_ROOT_DIR="${KUBE_ROOT}/federation/apis/openapi-spec"
source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
make -C "${KUBE_ROOT}" WHAT="cmd/hyperkube"
function cleanup()
{
[[ -n "${APISERVER_PID-}" ]] && kill ${APISERVER_PID} 1>&2 2>/dev/null
kube::etcd::cleanup
kube::log::status "Clean up complete"
}
trap cleanup EXIT SIGINT
kube::golang::setup_env
ETCD_HOST=${ETCD_HOST:-127.0.0.1}
ETCD_PORT=${ETCD_PORT:-2379}
API_PORT=${API_PORT:-8050}
API_HOST=${API_HOST:-127.0.0.1}
kube::etcd::start
# Start federation-apiserver
kube::log::status "Starting federation-apiserver"
"${KUBE_OUTPUT_HOSTBIN}/hyperkube" federation-apiserver \
--insecure-bind-address="${API_HOST}" \
--bind-address="${API_HOST}" \
--insecure-port="${API_PORT}" \
--etcd-servers="http://${ETCD_HOST}:${ETCD_PORT}" \
--advertise-address="10.10.10.10" \
--service-cluster-ip-range="10.0.0.0/24" >/tmp/openapi-federation-api-server.log 2>&1 &
APISERVER_PID=$!
kube::util::wait_for_url "${API_HOST}:${API_PORT}/" "apiserver: "
OPENAPI_PATH="${API_HOST}:${API_PORT}/"
DEFAULT_GROUP_VERSIONS="v1 extensions/v1beta1 federation/v1beta1"
VERSIONS=${VERSIONS:-$DEFAULT_GROUP_VERSIONS}
kube::log::status "Updating " ${OPENAPI_ROOT_DIR}
OPENAPI_PATH="${OPENAPI_PATH}" OPENAPI_ROOT_DIR="${OPENAPI_ROOT_DIR}" VERSIONS="${VERSIONS}" kube::util::fetch-openapi-spec
kube::log::status "SUCCESS"
# ex: ts=2 sw=2 et filetype=sh