diff --git a/openapi/custom_objects_spec.json b/openapi/custom_objects_spec.json index f96b8fd..9ca0e4a 100644 --- a/openapi/custom_objects_spec.json +++ b/openapi/custom_objects_spec.json @@ -435,6 +435,298 @@ } } }, + "/apis/{group}/{version}/{plural}/{name}/status": { + "parameters": [ + { + "name": "group", + "in": "path", + "required": true, + "description": "the custom resource's group", + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "description": "the custom resource's version", + "type": "string" + }, + { + "name": "plural", + "in": "path", + "required": true, + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "the custom object's name", + "type": "string" + } + ], + "get": { + "description": "read status of the specified cluster scoped custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "operationId": "getClusterCustomObjectStatus", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "put": { + "description": "replace status of the cluster scoped specified custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "operationId": "replaceClusterCustomObjectStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "patch": { + "description": "partially update status of the specified cluster scoped custom object", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "operationId": "patchClusterCustomObjectStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "The JSON schema of the Resource to patch.", + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + } + }, + "/apis/{group}/{version}/{plural}/{name}/scale": { + "parameters": [ + { + "name": "group", + "in": "path", + "required": true, + "description": "the custom resource's group", + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "description": "the custom resource's version", + "type": "string" + }, + { + "name": "plural", + "in": "path", + "required": true, + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "the custom object's name", + "type": "string" + } + ], + "get": { + "description": "read scale of the specified custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "operationId": "getClusterCustomObjectScale", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "put": { + "description": "replace scale of the specified cluster scoped custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "operationId": "replaceClusterCustomObjectScale", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "201": { + "description": "Created", + "schema": { + "type": "object" + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "patch": { + "description": "partially update scale of the specified cluster scoped custom object", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "operationId": "patchClusterCustomObjectScale", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "description": "The JSON schema of the Resource to patch.", + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + } + }, "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}": { "parameters": [ { @@ -474,13 +766,214 @@ } ], "get": { - "operationId": "getNamespacedCustomObject", - "description": "Returns a namespace scoped custom object", + "operationId": "getNamespacedCustomObject", + "description": "Returns a namespace scoped custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "responses": { + "200": { + "description": "A single Resource", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "delete": { + "operationId": "deleteNamespacedCustomObject", + "description": "Deletes the specified namespace scoped custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1.DeleteOptions" + } + }, + { + "name": "gracePeriodSeconds", + "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.", + "in": "query" + }, + { + "name": "orphanDependents", + "uniqueItems": true, + "type": "boolean", + "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + "in": "query" + }, + { + "name": "propagationPolicy", + "uniqueItems": true, + "type": "string", + "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "patch": { + "operationId": "patchNamespacedCustomObject", + "description": "patch the specified namespace scoped custom object", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "description": "The JSON schema of the Resource to patch.", + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + }, + "put": { + "operationId": "replaceNamespacedCustomObject", + "description": "replace the specified namespace scoped custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "description": "The JSON schema of the Resource to replace.", + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "401": { + "description": "Unauthorized" + } + } + } + }, + "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status": { + "parameters": [ + { + "name": "group", + "in": "path", + "required": true, + "description": "the custom resource's group", + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "description": "the custom resource's version", + "type": "string" + }, + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The custom resource's namespace", + "type": "string" + }, + { + "name": "plural", + "in": "path", + "required": true, + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "the custom object's name", + "type": "string" + } + ], + "get": { + "description": "read status of the specified namespace scoped custom object", "consumes": [ "*/*" ], "produces": [ - "application/json" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "schemes": [ "https" @@ -488,9 +981,10 @@ "tags": [ "custom_objects" ], + "operationId": "getNamespacedCustomObjectStatus", "responses": { "200": { - "description": "A single Resource", + "description": "OK", "schema": { "type": "object" } @@ -500,14 +994,15 @@ } } }, - "delete": { - "operationId": "deleteNamespacedCustomObject", - "description": "Deletes the specified namespace scoped custom object", + "put": { + "description": "replace status of the specified namespace scoped custom object", "consumes": [ "*/*" ], "produces": [ - "application/json" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "schemes": [ "https" @@ -515,35 +1010,15 @@ "tags": [ "custom_objects" ], + "operationId": "replaceNamespacedCustomObjectStatus", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v1.DeleteOptions" + "type": "object" } - }, - { - "name": "gracePeriodSeconds", - "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.", - "in": "query" - }, - { - "name": "orphanDependents", - "uniqueItems": true, - "type": "boolean", - "description": "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - "in": "query" - }, - { - "name": "propagationPolicy", - "uniqueItems": true, - "type": "string", - "description": "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.", - "in": "query" } ], "responses": { @@ -553,19 +1028,26 @@ "type": "object" } }, + "201": { + "description": "Created", + "schema": { + "type": "object" + } + }, "401": { "description": "Unauthorized" } } }, "patch": { - "operationId": "patchNamespacedCustomObject", - "description": "patch the specified namespace scoped custom object", + "description": "partially update status of the specified namespace scoped custom object", "consumes": [ "application/merge-patch+json" ], "produces": [ - "application/json" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "schemes": [ "https" @@ -573,17 +1055,86 @@ "tags": [ "custom_objects" ], + "operationId": "patchNamespacedCustomObjectStatus", "parameters": [ { "name": "body", "in": "body", "required": true, - "description": "The JSON schema of the Resource to patch.", + "schema": { + "description": "The JSON schema of the Resource to patch.", + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", "schema": { "type": "object" } + }, + "401": { + "description": "Unauthorized" } + } + } + }, + "/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale": { + "parameters": [ + { + "name": "group", + "in": "path", + "required": true, + "description": "the custom resource's group", + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "description": "the custom resource's version", + "type": "string" + }, + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The custom resource's namespace", + "type": "string" + }, + { + "name": "plural", + "in": "path", + "required": true, + "description": "the custom resource's plural name. For TPRs this would be lowercase plural kind.", + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "the custom object's name", + "type": "string" + } + ], + "get": { + "description": "read scale of the specified namespace scoped custom object", + "consumes": [ + "*/*" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" ], + "operationId": "getNamespacedCustomObjectScale", "responses": { "200": { "description": "OK", @@ -597,13 +1148,14 @@ } }, "put": { - "operationId": "replaceNamespacedCustomObject", - "description": "replace the specified namespace scoped custom object", + "description": "replace scale of the specified namespace scoped custom object", "consumes": [ "*/*" ], "produces": [ - "application/json" + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" ], "schemes": [ "https" @@ -611,13 +1163,59 @@ "tags": [ "custom_objects" ], + "operationId": "replaceNamespacedCustomObjectScale", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object" + } + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "object" + } + }, + "201": { + "description": "Created", + "schema": { + "type": "object" + } + } + }, + "401": { + "description": "Unauthorized" + } + }, + "patch": { + "description": "partially update scale of the specified namespace scoped custom object", + "consumes": [ + "application/merge-patch+json" + ], + "produces": [ + "application/json", + "application/yaml", + "application/vnd.kubernetes.protobuf" + ], + "schemes": [ + "https" + ], + "tags": [ + "custom_objects" + ], + "operationId": "patchNamespacedCustomObjectScale", "parameters": [ { "name": "body", "in": "body", "required": true, - "description": "The JSON schema of the Resource to replace.", "schema": { + "description": "The JSON schema of the Resource to patch.", "type": "object" } } diff --git a/openapi/preprocess_spec.py b/openapi/preprocess_spec.py index 5e67813..ab81af6 100644 --- a/openapi/preprocess_spec.py +++ b/openapi/preprocess_spec.py @@ -317,7 +317,7 @@ def main(): pool = urllib3.PoolManager() with pool.request('GET', spec_url, preload_content=False) as response: if response.status != 200: - print("Error downloading spec file. Reason: %s" % response.reason) + print("Error downloading spec file %s. Reason: %s" % (spec_url, response.reason)) return 1 in_spec = json.load(response, object_pairs_hook=OrderedDict) write_json(args.output_spec_path + ".unprocessed", in_spec)