diff --git a/federation/apis/openapi-spec/swagger.json b/federation/apis/openapi-spec/swagger.json index 025601e294c..beb7516ddfc 100644 --- a/federation/apis/openapi-spec/swagger.json +++ b/federation/apis/openapi-spec/swagger.json @@ -3883,6 +3883,937 @@ } } }, + "/apis/autoscaling/": { + "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" + ], + "tags": [ + "autoscaling" + ], + "operationId": "getAutoscalingAPIGroup", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.APIGroup" + } + }, + "401": { + "description": "Unauthorized" + } + } + } + }, + "/apis/autoscaling/v1/": { + "get": { + "description": "get available resources", + "consumes": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "getAutoscalingV1APIResources", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.APIResourceList" + } + }, + "401": { + "description": "Unauthorized" + } + } + } + }, + "/apis/autoscaling/v1/horizontalpodautoscalers": { + "get": { + "description": "list or watch objects of kind HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "listAutoscalingV1HorizontalPodAutoscalerForAllNamespaces", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscalerList" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "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'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.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ] + }, + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers": { + "get": { + "description": "list or watch objects of kind HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "listAutoscalingV1NamespacedHorizontalPodAutoscaler", + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "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'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.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscalerList" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "post": { + "description": "create a HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "createAutoscalingV1NamespacedHorizontalPodAutoscaler", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "delete": { + "description": "delete collection of HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "deleteAutoscalingV1CollectionNamespacedHorizontalPodAutoscaler", + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "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'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.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.Status" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "object name and auth scope, such as for teams and projects", + "name": "namespace", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + } + ] + }, + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}": { + "get": { + "description": "read the specified HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "readAutoscalingV1NamespacedHorizontalPodAutoscaler", + "parameters": [ + { + "uniqueItems": true, + "type": "boolean", + "description": "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.", + "name": "exact", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Should this value be exported. Export strips fields that a user can not specify.", + "name": "export", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "put": { + "description": "replace the specified HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "replaceAutoscalingV1NamespacedHorizontalPodAutoscaler", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "delete": { + "description": "delete a HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "deleteAutoscalingV1NamespacedHorizontalPodAutoscaler", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.DeleteOptions" + } + }, + { + "uniqueItems": true, + "type": "integer", + "description": "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.", + "name": "gracePeriodSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list.", + "name": "orphanDependents", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.Status" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "patch": { + "description": "partially update the specified HorizontalPodAutoscaler", + "consumes": [ + "application/json-patch+json", + "application/merge-patch+json", + "application/strategic-merge-patch+json" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "patchAutoscalingV1NamespacedHorizontalPodAutoscaler", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.Patch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "name of the HorizontalPodAutoscaler", + "name": "name", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "object name and auth scope, such as for teams and projects", + "name": "namespace", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + } + ] + }, + "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status": { + "get": { + "description": "read status of the specified HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "readAutoscalingV1NamespacedHorizontalPodAutoscalerStatus", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "put": { + "description": "replace status of the specified HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "replaceAutoscalingV1NamespacedHorizontalPodAutoscalerStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "patch": { + "description": "partially update status of the specified HorizontalPodAutoscaler", + "consumes": [ + "application/json-patch+json", + "application/merge-patch+json", + "application/strategic-merge-patch+json" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "patchAutoscalingV1NamespacedHorizontalPodAutoscalerStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.Patch" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "name of the HorizontalPodAutoscaler", + "name": "name", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "object name and auth scope, such as for teams and projects", + "name": "namespace", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + } + ] + }, + "/apis/autoscaling/v1/watch/horizontalpodautoscalers": { + "get": { + "description": "watch individual changes to a list of HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "watchAutoscalingV1HorizontalPodAutoscalerListForAllNamespaces", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.WatchEvent" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "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'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.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ] + }, + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers": { + "get": { + "description": "watch individual changes to a list of HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "watchAutoscalingV1NamespacedHorizontalPodAutoscalerList", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.WatchEvent" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "object name and auth scope, such as for teams and projects", + "name": "namespace", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "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'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.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ] + }, + "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}": { + "get": { + "description": "watch changes to an object of kind HorizontalPodAutoscaler", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf", + "application/json;stream=watch", + "application/vnd.kubernetes.protobuf;stream=watch" + ], + "schemes": [ + "https" + ], + "tags": [ + "autoscaling_v1" + ], + "operationId": "watchAutoscalingV1NamespacedHorizontalPodAutoscaler", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.WatchEvent" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "parameters": [ + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + "name": "fieldSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + "name": "labelSelector", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "name of the HorizontalPodAutoscaler", + "name": "name", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "object name and auth scope, such as for teams and projects", + "name": "namespace", + "in": "path", + "required": true + }, + { + "uniqueItems": true, + "type": "string", + "description": "If 'true', then the output is pretty printed.", + "name": "pretty", + "in": "query" + }, + { + "uniqueItems": true, + "type": "string", + "description": "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'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.", + "name": "resourceVersion", + "in": "query" + }, + { + "uniqueItems": true, + "type": "integer", + "description": "Timeout for the list/watch call.", + "name": "timeoutSeconds", + "in": "query" + }, + { + "uniqueItems": true, + "type": "boolean", + "description": "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + "name": "watch", + "in": "query" + } + ] + }, "/apis/batch/": { "get": { "description": "get information of a group", @@ -10014,6 +10945,27 @@ } } }, + "v1.CrossVersionObjectReference": { + "description": "CrossVersionObjectReference contains enough information to let you identify the referred resource.", + "required": [ + "kind", + "name" + ], + "properties": { + "apiVersion": { + "description": "API version of the referent", + "type": "string" + }, + "kind": { + "description": "Kind of the referent; More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds\"", + "type": "string" + }, + "name": { + "description": "Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names", + "type": "string" + } + } + }, "v1.DeleteOptions": { "description": "DeleteOptions may be provided when deleting an API object", "properties": { @@ -10476,6 +11428,119 @@ } } }, + "v1.HorizontalPodAutoscaler": { + "description": "configuration of a horizontal pod autoscaler.", + "properties": { + "apiVersion": { + "description": "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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources", + "type": "string" + }, + "kind": { + "description": "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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "description": "Standard object metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "$ref": "#/definitions/v1.ObjectMeta" + }, + "spec": { + "description": "behaviour of autoscaler. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status.", + "$ref": "#/definitions/v1.HorizontalPodAutoscalerSpec" + }, + "status": { + "description": "current information about the autoscaler.", + "$ref": "#/definitions/v1.HorizontalPodAutoscalerStatus" + } + } + }, + "v1.HorizontalPodAutoscalerList": { + "description": "list of horizontal pod autoscaler objects.", + "required": [ + "items" + ], + "properties": { + "apiVersion": { + "description": "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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources", + "type": "string" + }, + "items": { + "description": "list of horizontal pod autoscaler objects.", + "type": "array", + "items": { + "$ref": "#/definitions/v1.HorizontalPodAutoscaler" + } + }, + "kind": { + "description": "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: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds", + "type": "string" + }, + "metadata": { + "description": "Standard list metadata.", + "$ref": "#/definitions/v1.ListMeta" + } + } + }, + "v1.HorizontalPodAutoscalerSpec": { + "description": "specification of a horizontal pod autoscaler.", + "required": [ + "scaleTargetRef", + "maxReplicas" + ], + "properties": { + "maxReplicas": { + "description": "upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.", + "type": "integer", + "format": "int32" + }, + "minReplicas": { + "description": "lower limit for the number of pods that can be set by the autoscaler, default 1.", + "type": "integer", + "format": "int32" + }, + "scaleTargetRef": { + "description": "reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.", + "$ref": "#/definitions/v1.CrossVersionObjectReference" + }, + "targetCPUUtilizationPercentage": { + "description": "target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.", + "type": "integer", + "format": "int32" + } + } + }, + "v1.HorizontalPodAutoscalerStatus": { + "description": "current status of a horizontal pod autoscaler", + "required": [ + "currentReplicas", + "desiredReplicas" + ], + "properties": { + "currentCPUUtilizationPercentage": { + "description": "current average CPU utilization over all pods, represented as a percentage of requested CPU, e.g. 70 means that an average pod is using now 70% of its requested CPU.", + "type": "integer", + "format": "int32" + }, + "currentReplicas": { + "description": "current number of replicas of pods managed by this autoscaler.", + "type": "integer", + "format": "int32" + }, + "desiredReplicas": { + "description": "desired number of replicas of pods managed by this autoscaler.", + "type": "integer", + "format": "int32" + }, + "lastScaleTime": { + "description": "last time the HorizontalPodAutoscaler scaled the number of pods; used by the autoscaler to control how often the number of pods is changed.", + "$ref": "#/definitions/v1.Time" + }, + "observedGeneration": { + "description": "most recent generation observed by this autoscaler.", + "type": "integer", + "format": "int64" + } + } + }, "v1.HostPathVolumeSource": { "description": "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", "required": [ diff --git a/federation/client/clientset_generated/federation_clientset/BUILD b/federation/client/clientset_generated/federation_clientset/BUILD index 8ad7222816b..c90644842c5 100644 --- a/federation/client/clientset_generated/federation_clientset/BUILD +++ b/federation/client/clientset_generated/federation_clientset/BUILD @@ -17,6 +17,7 @@ go_library( tags = ["automanaged"], deps = [ "//federation/apis/federation/install:go_default_library", + "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:go_default_library", "//federation/client/clientset_generated/federation_clientset/typed/batch/v1:go_default_library", "//federation/client/clientset_generated/federation_clientset/typed/core/v1:go_default_library", "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1:go_default_library", @@ -41,6 +42,7 @@ filegroup( srcs = [ ":package-srcs", "//federation/client/clientset_generated/federation_clientset/fake:all-srcs", + "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:all-srcs", "//federation/client/clientset_generated/federation_clientset/typed/batch/v1:all-srcs", "//federation/client/clientset_generated/federation_clientset/typed/core/v1:all-srcs", "//federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1:all-srcs", diff --git a/federation/client/clientset_generated/federation_clientset/clientset.go b/federation/client/clientset_generated/federation_clientset/clientset.go index 7ce9fdd07a1..c2c2ff5dae3 100644 --- a/federation/client/clientset_generated/federation_clientset/clientset.go +++ b/federation/client/clientset_generated/federation_clientset/clientset.go @@ -21,6 +21,7 @@ import ( "k8s.io/client-go/pkg/util/flowcontrol" _ "k8s.io/client-go/plugin/pkg/client/auth" rest "k8s.io/client-go/rest" + v1autoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1" v1batch "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1" v1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1" v1beta1extensions "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1" @@ -33,6 +34,9 @@ type Interface interface { CoreV1() v1core.CoreV1Interface // Deprecated: please explicitly pick a version if possible. Core() v1core.CoreV1Interface + AutoscalingV1() v1autoscaling.AutoscalingV1Interface + // Deprecated: please explicitly pick a version if possible. + Autoscaling() v1autoscaling.AutoscalingV1Interface BatchV1() v1batch.BatchV1Interface // Deprecated: please explicitly pick a version if possible. Batch() v1batch.BatchV1Interface @@ -49,6 +53,7 @@ type Interface interface { type Clientset struct { *discovery.DiscoveryClient *v1core.CoreV1Client + *v1autoscaling.AutoscalingV1Client *v1batch.BatchV1Client *v1beta1extensions.ExtensionsV1beta1Client *v1beta1federation.FederationV1beta1Client @@ -71,6 +76,23 @@ func (c *Clientset) Core() v1core.CoreV1Interface { return c.CoreV1Client } +// AutoscalingV1 retrieves the AutoscalingV1Client +func (c *Clientset) AutoscalingV1() v1autoscaling.AutoscalingV1Interface { + if c == nil { + return nil + } + return c.AutoscalingV1Client +} + +// Deprecated: Autoscaling retrieves the default version of AutoscalingClient. +// Please explicitly pick a version. +func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingV1Interface { + if c == nil { + return nil + } + return c.AutoscalingV1Client +} + // BatchV1 retrieves the BatchV1Client func (c *Clientset) BatchV1() v1batch.BatchV1Interface { if c == nil { @@ -142,6 +164,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } + cs.AutoscalingV1Client, err = v1autoscaling.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.BatchV1Client, err = v1batch.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -168,6 +194,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset cs.CoreV1Client = v1core.NewForConfigOrDie(c) + cs.AutoscalingV1Client = v1autoscaling.NewForConfigOrDie(c) cs.BatchV1Client = v1batch.NewForConfigOrDie(c) cs.ExtensionsV1beta1Client = v1beta1extensions.NewForConfigOrDie(c) cs.FederationV1beta1Client = v1beta1federation.NewForConfigOrDie(c) @@ -180,6 +207,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.CoreV1Client = v1core.New(c) + cs.AutoscalingV1Client = v1autoscaling.New(c) cs.BatchV1Client = v1batch.New(c) cs.ExtensionsV1beta1Client = v1beta1extensions.New(c) cs.FederationV1beta1Client = v1beta1federation.New(c) diff --git a/federation/client/clientset_generated/federation_clientset/doc.go b/federation/client/clientset_generated/federation_clientset/doc.go index 4436df65585..9aa53e2b3b4 100644 --- a/federation/client/clientset_generated/federation_clientset/doc.go +++ b/federation/client/clientset_generated/federation_clientset/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // This package has the automatically generated clientset. package federation_clientset diff --git a/federation/client/clientset_generated/federation_clientset/fake/BUILD b/federation/client/clientset_generated/federation_clientset/fake/BUILD index e2e25c4a7d3..d247d7fdbd7 100644 --- a/federation/client/clientset_generated/federation_clientset/fake/BUILD +++ b/federation/client/clientset_generated/federation_clientset/fake/BUILD @@ -16,6 +16,8 @@ go_library( tags = ["automanaged"], deps = [ "//federation/client/clientset_generated/federation_clientset:go_default_library", + "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:go_default_library", + "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake:go_default_library", "//federation/client/clientset_generated/federation_clientset/typed/batch/v1:go_default_library", "//federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake:go_default_library", "//federation/client/clientset_generated/federation_clientset/typed/core/v1:go_default_library", diff --git a/federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go b/federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go index eeaea4cfd19..56c0df2358c 100644 --- a/federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go +++ b/federation/client/clientset_generated/federation_clientset/fake/clientset_generated.go @@ -20,6 +20,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset" + v1autoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1" + fakev1autoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake" v1batch "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1" fakev1batch "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake" v1core "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/core/v1" @@ -77,6 +79,16 @@ func (c *Clientset) Core() v1core.CoreV1Interface { return &fakev1core.FakeCoreV1{Fake: &c.Fake} } +// AutoscalingV1 retrieves the AutoscalingV1Client +func (c *Clientset) AutoscalingV1() v1autoscaling.AutoscalingV1Interface { + return &fakev1autoscaling.FakeAutoscalingV1{Fake: &c.Fake} +} + +// Autoscaling retrieves the AutoscalingV1Client +func (c *Clientset) Autoscaling() v1autoscaling.AutoscalingV1Interface { + return &fakev1autoscaling.FakeAutoscalingV1{Fake: &c.Fake} +} + // BatchV1 retrieves the BatchV1Client func (c *Clientset) BatchV1() v1batch.BatchV1Interface { return &fakev1batch.FakeBatchV1{Fake: &c.Fake} diff --git a/federation/client/clientset_generated/federation_clientset/fake/doc.go b/federation/client/clientset_generated/federation_clientset/fake/doc.go index 78881445cb3..05a5434be10 100644 --- a/federation/client/clientset_generated/federation_clientset/fake/doc.go +++ b/federation/client/clientset_generated/federation_clientset/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // This package has the automatically generated fake clientset. package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/BUILD b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/BUILD new file mode 100644 index 00000000000..4bb24d64462 --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/BUILD @@ -0,0 +1,46 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) + +go_library( + name = "go_default_library", + srcs = [ + "autoscaling_client.go", + "doc.go", + "generated_expansion.go", + "horizontalpodautoscaler.go", + ], + tags = ["automanaged"], + deps = [ + "//pkg/api:go_default_library", + "//pkg/api/v1:go_default_library", + "//pkg/apis/autoscaling/v1:go_default_library", + "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", + "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", + "//vendor:k8s.io/apimachinery/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [ + ":package-srcs", + "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake:all-srcs", + ], + tags = ["automanaged"], +) diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/autoscaling_client.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/autoscaling_client.go new file mode 100644 index 00000000000..0b501982096 --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/autoscaling_client.go @@ -0,0 +1,97 @@ +/* +Copyright 2017 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. +*/ + +package v1 + +import ( + fmt "fmt" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" + api "k8s.io/kubernetes/pkg/api" +) + +type AutoscalingV1Interface interface { + RESTClient() rest.Interface + HorizontalPodAutoscalersGetter +} + +// AutoscalingV1Client is used to interact with features provided by the autoscaling group. +type AutoscalingV1Client struct { + restClient rest.Interface +} + +func (c *AutoscalingV1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { + return newHorizontalPodAutoscalers(c, namespace) +} + +// NewForConfig creates a new AutoscalingV1Client for the given config. +func NewForConfig(c *rest.Config) (*AutoscalingV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AutoscalingV1Client{client}, nil +} + +// NewForConfigOrDie creates a new AutoscalingV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AutoscalingV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AutoscalingV1Client for the given RESTClient. +func New(c rest.Interface) *AutoscalingV1Client { + return &AutoscalingV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv, err := schema.ParseGroupVersion("autoscaling/v1") + if err != nil { + return err + } + // if autoscaling/v1 is not enabled, return an error + if !api.Registry.IsEnabledVersion(gv) { + return fmt.Errorf("autoscaling/v1 is not enabled") + } + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + copyGroupVersion := gv + config.GroupVersion = ©GroupVersion + + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: api.Codecs} + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AutoscalingV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/doc.go new file mode 100644 index 00000000000..7205930bab8 --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 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. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] + +// This package has the automatically generated typed clients. +package v1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/BUILD b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/BUILD new file mode 100644 index 00000000000..3ac6b119f0e --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/BUILD @@ -0,0 +1,43 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "fake_autoscaling_client.go", + "fake_horizontalpodautoscaler.go", + ], + tags = ["automanaged"], + deps = [ + "//federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1:go_default_library", + "//pkg/api/v1:go_default_library", + "//pkg/apis/autoscaling/v1:go_default_library", + "//pkg/client/testing/core:go_default_library", + "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", + "//vendor:k8s.io/apimachinery/pkg/labels", + "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", + "//vendor:k8s.io/apimachinery/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], +) diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/doc.go new file mode 100644 index 00000000000..91682eb2b2e --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 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. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] + +// Package fake has the automatically generated clients. +package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_autoscaling_client.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_autoscaling_client.go new file mode 100644 index 00000000000..8d005c87309 --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_autoscaling_client.go @@ -0,0 +1,38 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/kubernetes/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1" + core "k8s.io/kubernetes/pkg/client/testing/core" +) + +type FakeAutoscalingV1 struct { + *core.Fake +} + +func (c *FakeAutoscalingV1) HorizontalPodAutoscalers(namespace string) v1.HorizontalPodAutoscalerInterface { + return &FakeHorizontalPodAutoscalers{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAutoscalingV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go new file mode 100644 index 00000000000..b6e3cad024d --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -0,0 +1,129 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + api_v1 "k8s.io/kubernetes/pkg/api/v1" + v1 "k8s.io/kubernetes/pkg/apis/autoscaling/v1" + core "k8s.io/kubernetes/pkg/client/testing/core" +) + +// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface +type FakeHorizontalPodAutoscalers struct { + Fake *FakeAutoscalingV1 + ns string +} + +var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autoscaling", Version: "v1", Resource: "horizontalpodautoscalers"} + +func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) { + obj, err := c.Fake. + Invokes(core.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api_v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(core.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{}) + + return err +} + +func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error { + action := core.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1.HorizontalPodAutoscalerList{}) + return err +} + +func (c *FakeHorizontalPodAutoscalers) Get(name string, options meta_v1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) List(opts api_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { + obj, err := c.Fake. + Invokes(core.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &v1.HorizontalPodAutoscalerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := core.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.HorizontalPodAutoscalerList{} + for _, item := range obj.(*v1.HorizontalPodAutoscalerList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. +func (c *FakeHorizontalPodAutoscalers) Watch(opts api_v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(core.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched horizontalPodAutoscaler. +func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &v1.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.HorizontalPodAutoscaler), err +} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/generated_expansion.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/generated_expansion.go new file mode 100644 index 00000000000..effefbd50b6 --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/generated_expansion.go @@ -0,0 +1,19 @@ +/* +Copyright 2017 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. +*/ + +package v1 + +type HorizontalPodAutoscalerExpansion interface{} diff --git a/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/horizontalpodautoscaler.go b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/horizontalpodautoscaler.go new file mode 100644 index 00000000000..7a268a04c87 --- /dev/null +++ b/federation/client/clientset_generated/federation_clientset/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -0,0 +1,173 @@ +/* +Copyright 2017 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. +*/ + +package v1 + +import ( + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + api "k8s.io/kubernetes/pkg/api" + api_v1 "k8s.io/kubernetes/pkg/api/v1" + v1 "k8s.io/kubernetes/pkg/apis/autoscaling/v1" +) + +// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. +// A group's client should implement this interface. +type HorizontalPodAutoscalersGetter interface { + HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface +} + +// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. +type HorizontalPodAutoscalerInterface interface { + Create(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) + Update(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) + UpdateStatus(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) + Delete(name string, options *api_v1.DeleteOptions) error + DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error + Get(name string, options meta_v1.GetOptions) (*v1.HorizontalPodAutoscaler, error) + List(opts api_v1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) + Watch(opts api_v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) + HorizontalPodAutoscalerExpansion +} + +// horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface +type horizontalPodAutoscalers struct { + client rest.Interface + ns string +} + +// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers +func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *horizontalPodAutoscalers { + return &horizontalPodAutoscalers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. +func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { + result = &v1.HorizontalPodAutoscaler{} + err = c.client.Post(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Body(horizontalPodAutoscaler). + Do(). + Into(result) + return +} + +// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. +func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { + result = &v1.HorizontalPodAutoscaler{} + err = c.client.Put(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(horizontalPodAutoscaler.Name). + Body(horizontalPodAutoscaler). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). + +func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { + result = &v1.HorizontalPodAutoscaler{} + err = c.client.Put(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(horizontalPodAutoscaler.Name). + SubResource("status"). + Body(horizontalPodAutoscaler). + Do(). + Into(result) + return +} + +// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. +func (c *horizontalPodAutoscalers) Delete(name string, options *api_v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *horizontalPodAutoscalers) DeleteCollection(options *api_v1.DeleteOptions, listOptions api_v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. +func (c *horizontalPodAutoscalers) Get(name string, options meta_v1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { + result = &v1.HorizontalPodAutoscaler{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(name). + VersionedParams(&options, api.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. +func (c *horizontalPodAutoscalers) List(opts api_v1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { + result = &v1.HorizontalPodAutoscalerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. +func (c *horizontalPodAutoscalers) Watch(opts api_v1.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched horizontalPodAutoscaler. +func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { + result = &v1.HorizontalPodAutoscaler{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go index 1416283f5e4..7205930bab8 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // This package has the automatically generated typed clients. package v1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go index 0a5c6b14274..91682eb2b2e 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/batch/v1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // Package fake has the automatically generated clients. package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go index 1416283f5e4..7205930bab8 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/core/v1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // This package has the automatically generated typed clients. package v1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go index 0a5c6b14274..91682eb2b2e 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/core/v1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // Package fake has the automatically generated clients. package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go index 9329e027f6b..73f020dbeff 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // This package has the automatically generated typed clients. package v1beta1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go index 0a5c6b14274..91682eb2b2e 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/extensions/v1beta1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // Package fake has the automatically generated clients. package fake diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go index 9329e027f6b..73f020dbeff 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // This package has the automatically generated typed clients. package v1beta1 diff --git a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go index 0a5c6b14274..91682eb2b2e 100644 --- a/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go +++ b/federation/client/clientset_generated/federation_clientset/typed/federation/v1beta1/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1] +// This package is generated by client-gen with arguments: --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/v1beta1,api/v1,extensions/v1beta1,batch/v1,autoscaling/v1] // Package fake has the automatically generated clients. package fake diff --git a/federation/client/clientset_generated/federation_internalclientset/BUILD b/federation/client/clientset_generated/federation_internalclientset/BUILD index 595c18f0dd7..ec03da6e7ab 100644 --- a/federation/client/clientset_generated/federation_internalclientset/BUILD +++ b/federation/client/clientset_generated/federation_internalclientset/BUILD @@ -17,6 +17,7 @@ go_library( tags = ["automanaged"], deps = [ "//federation/apis/federation/install:go_default_library", + "//federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion:go_default_library", "//federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion:go_default_library", "//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion:go_default_library", "//federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion:go_default_library", @@ -41,6 +42,7 @@ filegroup( srcs = [ ":package-srcs", "//federation/client/clientset_generated/federation_internalclientset/fake:all-srcs", + "//federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion:all-srcs", "//federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion:all-srcs", "//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion:all-srcs", "//federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion:all-srcs", diff --git a/federation/client/clientset_generated/federation_internalclientset/clientset.go b/federation/client/clientset_generated/federation_internalclientset/clientset.go index f296acff198..8e9e36d413d 100644 --- a/federation/client/clientset_generated/federation_internalclientset/clientset.go +++ b/federation/client/clientset_generated/federation_internalclientset/clientset.go @@ -21,6 +21,7 @@ import ( "k8s.io/client-go/pkg/util/flowcontrol" _ "k8s.io/client-go/plugin/pkg/client/auth" rest "k8s.io/client-go/rest" + internalversionautoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion" internalversionbatch "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion" internalversioncore "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion" internalversionextensions "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion" @@ -32,6 +33,8 @@ type Interface interface { Discovery() discovery.DiscoveryInterface Core() internalversioncore.CoreInterface + Autoscaling() internalversionautoscaling.AutoscalingInterface + Batch() internalversionbatch.BatchInterface Extensions() internalversionextensions.ExtensionsInterface @@ -44,6 +47,7 @@ type Interface interface { type Clientset struct { *discovery.DiscoveryClient *internalversioncore.CoreClient + *internalversionautoscaling.AutoscalingClient *internalversionbatch.BatchClient *internalversionextensions.ExtensionsClient *internalversionfederation.FederationClient @@ -57,6 +61,14 @@ func (c *Clientset) Core() internalversioncore.CoreInterface { return c.CoreClient } +// Autoscaling retrieves the AutoscalingClient +func (c *Clientset) Autoscaling() internalversionautoscaling.AutoscalingInterface { + if c == nil { + return nil + } + return c.AutoscalingClient +} + // Batch retrieves the BatchClient func (c *Clientset) Batch() internalversionbatch.BatchInterface { if c == nil { @@ -101,6 +113,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { if err != nil { return nil, err } + cs.AutoscalingClient, err = internalversionautoscaling.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.BatchClient, err = internalversionbatch.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -127,6 +143,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset cs.CoreClient = internalversioncore.NewForConfigOrDie(c) + cs.AutoscalingClient = internalversionautoscaling.NewForConfigOrDie(c) cs.BatchClient = internalversionbatch.NewForConfigOrDie(c) cs.ExtensionsClient = internalversionextensions.NewForConfigOrDie(c) cs.FederationClient = internalversionfederation.NewForConfigOrDie(c) @@ -139,6 +156,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.CoreClient = internalversioncore.New(c) + cs.AutoscalingClient = internalversionautoscaling.New(c) cs.BatchClient = internalversionbatch.New(c) cs.ExtensionsClient = internalversionextensions.New(c) cs.FederationClient = internalversionfederation.New(c) diff --git a/federation/client/clientset_generated/federation_internalclientset/doc.go b/federation/client/clientset_generated/federation_internalclientset/doc.go index 90067b7d970..b74afe7d9b6 100644 --- a/federation/client/clientset_generated/federation_internalclientset/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // This package has the automatically generated clientset. package federation_internalclientset diff --git a/federation/client/clientset_generated/federation_internalclientset/fake/BUILD b/federation/client/clientset_generated/federation_internalclientset/fake/BUILD index 7f6ab8ad514..78998607ce8 100644 --- a/federation/client/clientset_generated/federation_internalclientset/fake/BUILD +++ b/federation/client/clientset_generated/federation_internalclientset/fake/BUILD @@ -16,6 +16,8 @@ go_library( tags = ["automanaged"], deps = [ "//federation/client/clientset_generated/federation_internalclientset:go_default_library", + "//federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion:go_default_library", + "//federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake:go_default_library", "//federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion:go_default_library", "//federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/fake:go_default_library", "//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion:go_default_library", diff --git a/federation/client/clientset_generated/federation_internalclientset/fake/clientset_generated.go b/federation/client/clientset_generated/federation_internalclientset/fake/clientset_generated.go index fefa283e115..00b5104a1f5 100644 --- a/federation/client/clientset_generated/federation_internalclientset/fake/clientset_generated.go +++ b/federation/client/clientset_generated/federation_internalclientset/fake/clientset_generated.go @@ -20,6 +20,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset" + internalversionautoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion" + fakeinternalversionautoscaling "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake" internalversionbatch "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion" fakeinternalversionbatch "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/fake" internalversioncore "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion" @@ -72,6 +74,11 @@ func (c *Clientset) Core() internalversioncore.CoreInterface { return &fakeinternalversioncore.FakeCore{Fake: &c.Fake} } +// Autoscaling retrieves the AutoscalingClient +func (c *Clientset) Autoscaling() internalversionautoscaling.AutoscalingInterface { + return &fakeinternalversionautoscaling.FakeAutoscaling{Fake: &c.Fake} +} + // Batch retrieves the BatchClient func (c *Clientset) Batch() internalversionbatch.BatchInterface { return &fakeinternalversionbatch.FakeBatch{Fake: &c.Fake} diff --git a/federation/client/clientset_generated/federation_internalclientset/fake/doc.go b/federation/client/clientset_generated/federation_internalclientset/fake/doc.go index 5d9d5bf5926..61e9ad46cc1 100644 --- a/federation/client/clientset_generated/federation_internalclientset/fake/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // This package has the automatically generated fake clientset. package fake diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/BUILD b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/BUILD new file mode 100644 index 00000000000..a4e32ff4897 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/BUILD @@ -0,0 +1,43 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) + +go_library( + name = "go_default_library", + srcs = [ + "autoscaling_client.go", + "doc.go", + "generated_expansion.go", + "horizontalpodautoscaler.go", + ], + tags = ["automanaged"], + deps = [ + "//pkg/api:go_default_library", + "//pkg/apis/autoscaling:go_default_library", + "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", + "//vendor:k8s.io/apimachinery/pkg/types", + "//vendor:k8s.io/apimachinery/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [ + ":package-srcs", + "//federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake:all-srcs", + ], + tags = ["automanaged"], +) diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/autoscaling_client.go b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/autoscaling_client.go new file mode 100644 index 00000000000..325e11ba020 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/autoscaling_client.go @@ -0,0 +1,98 @@ +/* +Copyright 2017 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. +*/ + +package internalversion + +import ( + rest "k8s.io/client-go/rest" + api "k8s.io/kubernetes/pkg/api" +) + +type AutoscalingInterface interface { + RESTClient() rest.Interface + HorizontalPodAutoscalersGetter +} + +// AutoscalingClient is used to interact with features provided by the autoscaling group. +type AutoscalingClient struct { + restClient rest.Interface +} + +func (c *AutoscalingClient) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { + return newHorizontalPodAutoscalers(c, namespace) +} + +// NewForConfig creates a new AutoscalingClient for the given config. +func NewForConfig(c *rest.Config) (*AutoscalingClient, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AutoscalingClient{client}, nil +} + +// NewForConfigOrDie creates a new AutoscalingClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AutoscalingClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AutoscalingClient for the given RESTClient. +func New(c rest.Interface) *AutoscalingClient { + return &AutoscalingClient{c} +} + +func setConfigDefaults(config *rest.Config) error { + // if autoscaling group is not registered, return an error + g, err := api.Registry.Group("autoscaling") + if err != nil { + return err + } + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group { + copyGroupVersion := g.GroupVersion + config.GroupVersion = ©GroupVersion + } + config.NegotiatedSerializer = api.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AutoscalingClient) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/doc.go new file mode 100644 index 00000000000..8ffebfae95a --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 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. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] + +// This package has the automatically generated typed clients. +package internalversion diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/BUILD b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/BUILD new file mode 100644 index 00000000000..580b91acc67 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/BUILD @@ -0,0 +1,43 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +load( + "@io_bazel_rules_go//go:def.bzl", + "go_library", +) + +go_library( + name = "go_default_library", + srcs = [ + "doc.go", + "fake_autoscaling_client.go", + "fake_horizontalpodautoscaler.go", + ], + tags = ["automanaged"], + deps = [ + "//federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion:go_default_library", + "//pkg/api:go_default_library", + "//pkg/apis/autoscaling:go_default_library", + "//pkg/client/testing/core:go_default_library", + "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", + "//vendor:k8s.io/apimachinery/pkg/labels", + "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", + "//vendor:k8s.io/apimachinery/pkg/watch", + "//vendor:k8s.io/client-go/rest", + ], +) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], +) diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/doc.go new file mode 100644 index 00000000000..6f13dc4e32f --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2017 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. +*/ + +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] + +// Package fake has the automatically generated clients. +package fake diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/fake_autoscaling_client.go b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/fake_autoscaling_client.go new file mode 100644 index 00000000000..a2f8bcb93e0 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/fake_autoscaling_client.go @@ -0,0 +1,38 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + rest "k8s.io/client-go/rest" + internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion" + core "k8s.io/kubernetes/pkg/client/testing/core" +) + +type FakeAutoscaling struct { + *core.Fake +} + +func (c *FakeAutoscaling) HorizontalPodAutoscalers(namespace string) internalversion.HorizontalPodAutoscalerInterface { + return &FakeHorizontalPodAutoscalers{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAutoscaling) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/fake_horizontalpodautoscaler.go b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/fake_horizontalpodautoscaler.go new file mode 100644 index 00000000000..06938475820 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/fake/fake_horizontalpodautoscaler.go @@ -0,0 +1,129 @@ +/* +Copyright 2017 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. +*/ + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + api "k8s.io/kubernetes/pkg/api" + autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" + core "k8s.io/kubernetes/pkg/client/testing/core" +) + +// FakeHorizontalPodAutoscalers implements HorizontalPodAutoscalerInterface +type FakeHorizontalPodAutoscalers struct { + Fake *FakeAutoscaling + ns string +} + +var horizontalpodautoscalersResource = schema.GroupVersionResource{Group: "autoscaling", Version: "", Resource: "horizontalpodautoscalers"} + +func (c *FakeHorizontalPodAutoscalers) Create(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscaling.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) Update(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscaling.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (*autoscaling.HorizontalPodAutoscaler, error) { + obj, err := c.Fake. + Invokes(core.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &autoscaling.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscaling.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error { + _, err := c.Fake. + Invokes(core.NewDeleteAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{}) + + return err +} + +func (c *FakeHorizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + action := core.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &autoscaling.HorizontalPodAutoscalerList{}) + return err +} + +func (c *FakeHorizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *autoscaling.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &autoscaling.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscaling.HorizontalPodAutoscaler), err +} + +func (c *FakeHorizontalPodAutoscalers) List(opts api.ListOptions) (result *autoscaling.HorizontalPodAutoscalerList, err error) { + obj, err := c.Fake. + Invokes(core.NewListAction(horizontalpodautoscalersResource, c.ns, opts), &autoscaling.HorizontalPodAutoscalerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := core.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &autoscaling.HorizontalPodAutoscalerList{} + for _, item := range obj.(*autoscaling.HorizontalPodAutoscalerList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. +func (c *FakeHorizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(core.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched horizontalPodAutoscaler. +func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *autoscaling.HorizontalPodAutoscaler, err error) { + obj, err := c.Fake. + Invokes(core.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &autoscaling.HorizontalPodAutoscaler{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscaling.HorizontalPodAutoscaler), err +} diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/generated_expansion.go b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/generated_expansion.go new file mode 100644 index 00000000000..bf7296c51a1 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/generated_expansion.go @@ -0,0 +1,19 @@ +/* +Copyright 2017 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. +*/ + +package internalversion + +type HorizontalPodAutoscalerExpansion interface{} diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/horizontalpodautoscaler.go b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/horizontalpodautoscaler.go new file mode 100644 index 00000000000..74bf1376e97 --- /dev/null +++ b/federation/client/clientset_generated/federation_internalclientset/typed/autoscaling/internalversion/horizontalpodautoscaler.go @@ -0,0 +1,172 @@ +/* +Copyright 2017 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. +*/ + +package internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + api "k8s.io/kubernetes/pkg/api" + autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" +) + +// HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. +// A group's client should implement this interface. +type HorizontalPodAutoscalersGetter interface { + HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface +} + +// HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. +type HorizontalPodAutoscalerInterface interface { + Create(*autoscaling.HorizontalPodAutoscaler) (*autoscaling.HorizontalPodAutoscaler, error) + Update(*autoscaling.HorizontalPodAutoscaler) (*autoscaling.HorizontalPodAutoscaler, error) + UpdateStatus(*autoscaling.HorizontalPodAutoscaler) (*autoscaling.HorizontalPodAutoscaler, error) + Delete(name string, options *api.DeleteOptions) error + DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error + Get(name string, options v1.GetOptions) (*autoscaling.HorizontalPodAutoscaler, error) + List(opts api.ListOptions) (*autoscaling.HorizontalPodAutoscalerList, error) + Watch(opts api.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *autoscaling.HorizontalPodAutoscaler, err error) + HorizontalPodAutoscalerExpansion +} + +// horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface +type horizontalPodAutoscalers struct { + client rest.Interface + ns string +} + +// newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers +func newHorizontalPodAutoscalers(c *AutoscalingClient, namespace string) *horizontalPodAutoscalers { + return &horizontalPodAutoscalers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. +func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) { + result = &autoscaling.HorizontalPodAutoscaler{} + err = c.client.Post(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Body(horizontalPodAutoscaler). + Do(). + Into(result) + return +} + +// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. +func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) { + result = &autoscaling.HorizontalPodAutoscaler{} + err = c.client.Put(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(horizontalPodAutoscaler.Name). + Body(horizontalPodAutoscaler). + Do(). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). + +func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *autoscaling.HorizontalPodAutoscaler) (result *autoscaling.HorizontalPodAutoscaler, err error) { + result = &autoscaling.HorizontalPodAutoscaler{} + err = c.client.Put(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(horizontalPodAutoscaler.Name). + SubResource("status"). + Body(horizontalPodAutoscaler). + Do(). + Into(result) + return +} + +// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. +func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *horizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&listOptions, api.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. +func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *autoscaling.HorizontalPodAutoscaler, err error) { + result = &autoscaling.HorizontalPodAutoscaler{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + Name(name). + VersionedParams(&options, api.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. +func (c *horizontalPodAutoscalers) List(opts api.ListOptions) (result *autoscaling.HorizontalPodAutoscalerList, err error) { + result = &autoscaling.HorizontalPodAutoscalerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, api.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. +func (c *horizontalPodAutoscalers) Watch(opts api.ListOptions) (watch.Interface, error) { + return c.client.Get(). + Prefix("watch"). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, api.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched horizontalPodAutoscaler. +func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *autoscaling.HorizontalPodAutoscaler, err error) { + result = &autoscaling.HorizontalPodAutoscaler{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/doc.go index 90ba8be0416..8ffebfae95a 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // This package has the automatically generated typed clients. package internalversion diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/fake/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/fake/doc.go index f45ab0101f1..6f13dc4e32f 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/fake/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/batch/internalversion/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // Package fake has the automatically generated clients. package fake diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/doc.go index 90ba8be0416..8ffebfae95a 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // This package has the automatically generated typed clients. package internalversion diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/doc.go index f45ab0101f1..6f13dc4e32f 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // Package fake has the automatically generated clients. package fake diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/doc.go index 90ba8be0416..8ffebfae95a 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // This package has the automatically generated typed clients. package internalversion diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/doc.go index f45ab0101f1..6f13dc4e32f 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // Package fake has the automatically generated clients. package fake diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/doc.go index 90ba8be0416..8ffebfae95a 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // This package has the automatically generated typed clients. package internalversion diff --git a/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/doc.go b/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/doc.go index f45ab0101f1..6f13dc4e32f 100644 --- a/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/doc.go +++ b/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job] --input=[../../federation/apis/federation/,api/,extensions/,batch/] +// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler] --input=[../../federation/apis/federation/,api/,extensions/,batch/,autoscaling/] // Package fake has the automatically generated clients. package fake diff --git a/federation/cmd/federation-apiserver/app/BUILD b/federation/cmd/federation-apiserver/app/BUILD index 174064cb991..f559adc5439 100644 --- a/federation/cmd/federation-apiserver/app/BUILD +++ b/federation/cmd/federation-apiserver/app/BUILD @@ -10,6 +10,7 @@ load( go_library( name = "go_default_library", srcs = [ + "autoscaling.go", "batch.go", "core.go", "extensions.go", @@ -28,6 +29,8 @@ go_library( "//federation/registry/cluster/etcd:go_default_library", "//pkg/api:go_default_library", "//pkg/api/install:go_default_library", + "//pkg/apis/autoscaling:go_default_library", + "//pkg/apis/autoscaling/install:go_default_library", "//pkg/apis/batch:go_default_library", "//pkg/apis/batch/install:go_default_library", "//pkg/apis/extensions:go_default_library", @@ -43,6 +46,7 @@ go_library( "//pkg/genericapiserver/server/filters:go_default_library", "//pkg/kubeapiserver:go_default_library", "//pkg/kubeapiserver/admission:go_default_library", + "//pkg/registry/autoscaling/horizontalpodautoscaler/storage:go_default_library", "//pkg/registry/batch/job/storage:go_default_library", "//pkg/registry/cachesize:go_default_library", "//pkg/registry/core/configmap/storage:go_default_library", diff --git a/federation/cmd/federation-apiserver/app/autoscaling.go b/federation/cmd/federation-apiserver/app/autoscaling.go new file mode 100644 index 00000000000..ac7655caedf --- /dev/null +++ b/federation/cmd/federation-apiserver/app/autoscaling.go @@ -0,0 +1,51 @@ +/* +Copyright 2016 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. +*/ + +package app + +import ( + "github.com/golang/glog" + "k8s.io/kubernetes/pkg/api" + "k8s.io/kubernetes/pkg/apis/autoscaling" + _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" + "k8s.io/kubernetes/pkg/genericapiserver/registry/generic" + "k8s.io/kubernetes/pkg/genericapiserver/registry/rest" + genericapiserver "k8s.io/kubernetes/pkg/genericapiserver/server" + hpastorage "k8s.io/kubernetes/pkg/registry/autoscaling/horizontalpodautoscaler/storage" +) + +func installAutoscalingAPIs(g *genericapiserver.GenericAPIServer, optsGetter generic.RESTOptionsGetter) { + hpaStorage, hpaStatusStorage := hpastorage.NewREST(optsGetter) + + autoscalingResources := map[string]rest.Storage{ + "horizontalpodautoscalers": hpaStorage, + "horizontalpodautoscalers/status": hpaStatusStorage, + } + autoscalingGroupMeta := api.Registry.GroupOrDie(autoscaling.GroupName) + apiGroupInfo := genericapiserver.APIGroupInfo{ + GroupMeta: *autoscalingGroupMeta, + VersionedResourcesStorageMap: map[string]map[string]rest.Storage{ + "v1": autoscalingResources, + }, + OptionsExternalVersion: &api.Registry.GroupOrDie(api.GroupName).GroupVersion, + Scheme: api.Scheme, + ParameterCodec: api.ParameterCodec, + NegotiatedSerializer: api.Codecs, + } + if err := g.InstallAPIGroup(&apiGroupInfo); err != nil { + glog.Fatalf("Error in registering group versions: %v", err) + } +} diff --git a/federation/cmd/federation-apiserver/app/server.go b/federation/cmd/federation-apiserver/app/server.go index 675bb148c60..6fe05949a96 100644 --- a/federation/cmd/federation-apiserver/app/server.go +++ b/federation/cmd/federation-apiserver/app/server.go @@ -213,6 +213,7 @@ func Run(s *options.ServerRunOptions) error { installCoreAPIs(s, m, restOptionsFactory) installExtensionsAPIs(m, restOptionsFactory) installBatchAPIs(m, restOptionsFactory) + installAutoscalingAPIs(m, restOptionsFactory) sharedInformers.Start(wait.NeverStop) m.PrepareRun().Run(wait.NeverStop) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 6aafa7fb901..7b798d23606 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -62,8 +62,8 @@ ${clientgen} "$@" ${clientgen} -t "$@" ${clientgen} --clientset-name="clientset" --input="${GV_DIRS_CSV}" "$@" # Clientgen for federation clientset. -${clientgen} --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/","api/","extensions/","batch/" --included-types-overrides="api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job" "$@" -${clientgen} --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/v1beta1","api/v1","extensions/v1beta1","batch/v1" --included-types-overrides="api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job" "$@" +${clientgen} --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/","api/","extensions/","batch/","autoscaling/" --included-types-overrides="api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event,batch/Job,autoscaling/HorizontalPodAutoscaler" "$@" +${clientgen} --clientset-name=federation_clientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --input="../../federation/apis/federation/v1beta1","api/v1","extensions/v1beta1","batch/v1","autoscaling/v1" --included-types-overrides="api/v1/Service,api/v1/Namespace,extensions/v1beta1/ReplicaSet,api/v1/Secret,extensions/v1beta1/Ingress,extensions/v1beta1/Deployment,extensions/v1beta1/DaemonSet,api/v1/ConfigMap,api/v1/Event,batch/v1/Job,autoscaling/v1/HorizontalPodAutoscaler" "$@" LISTERGEN_APIS=( pkg/api diff --git a/test/integration/federation/BUILD b/test/integration/federation/BUILD index 20435db187a..d4c171393d2 100644 --- a/test/integration/federation/BUILD +++ b/test/integration/federation/BUILD @@ -16,6 +16,7 @@ go_test( "//federation/cmd/federation-apiserver/app:go_default_library", "//federation/cmd/federation-apiserver/app/options:go_default_library", "//pkg/api/v1:go_default_library", + "//pkg/apis/autoscaling/v1:go_default_library", "//pkg/apis/batch/v1:go_default_library", "//pkg/apis/extensions/v1beta1:go_default_library", "//vendor:github.com/stretchr/testify/assert", diff --git a/test/integration/federation/server_test.go b/test/integration/federation/server_test.go index cc6469a5097..15ecfc1fff9 100644 --- a/test/integration/federation/server_test.go +++ b/test/integration/federation/server_test.go @@ -33,6 +33,7 @@ import ( "k8s.io/kubernetes/federation/cmd/federation-apiserver/app" "k8s.io/kubernetes/federation/cmd/federation-apiserver/app/options" "k8s.io/kubernetes/pkg/api/v1" + autoscaling_v1 "k8s.io/kubernetes/pkg/apis/autoscaling/v1" batch_v1 "k8s.io/kubernetes/pkg/apis/batch/v1" ext_v1b1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" ) @@ -44,6 +45,7 @@ var groupVersions = []schema.GroupVersion{ fed_v1b1.SchemeGroupVersion, ext_v1b1.SchemeGroupVersion, batch_v1.SchemeGroupVersion, + autoscaling_v1.SchemeGroupVersion, } func TestRun(t *testing.T) { @@ -214,6 +216,7 @@ func testAPIResourceList(t *testing.T) { testCoreResourceList(t) testExtensionsResourceList(t) testBatchResourceList(t) + testAutoscalingResourceList(t) } func testFederationResourceList(t *testing.T) { @@ -373,3 +376,29 @@ func testBatchResourceList(t *testing.T) { assert.NotNil(t, found) assert.True(t, found.Namespaced) } + +func testAutoscalingResourceList(t *testing.T) { + serverURL := serverIP + "/apis/" + autoscaling_v1.SchemeGroupVersion.String() + contents, err := readResponse(serverURL) + if err != nil { + t.Fatalf("%v", err) + } + var apiResourceList metav1.APIResourceList + err = json.Unmarshal(contents, &apiResourceList) + if err != nil { + t.Fatalf("Error in unmarshalling response from server %s: %v", serverURL, err) + } + // empty APIVersion for extensions group + assert.Equal(t, "v1", apiResourceList.APIVersion) + assert.Equal(t, autoscaling_v1.SchemeGroupVersion.String(), apiResourceList.GroupVersion) + // Assert that there are exactly this number of resources. + assert.Equal(t, 2, len(apiResourceList.APIResources)) + + // Verify hpa + found := findResource(apiResourceList.APIResources, "horizontalpodautoscalers") + assert.NotNil(t, found) + assert.True(t, found.Namespaced) + found = findResource(apiResourceList.APIResources, "horizontalpodautoscalers/status") + assert.NotNil(t, found) + assert.True(t, found.Namespaced) +}