From 5d29f24c51d282641cd2a1560018256d29e1f56a Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Tue, 9 May 2017 07:02:17 +0300 Subject: [PATCH 1/8] Add support for thirdparty resource watch/create/put and delete operations --- .gitignore | 1 + scripts/preprocess_spec.py | 10 ++ scripts/thirdpartypaths.json | 251 +++++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+) create mode 100644 scripts/thirdpartypaths.json diff --git a/.gitignore b/.gitignore index 4bbc6b206e..bdd5055d15 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ target/ # Intellij IDEA files .idea/* *.iml +.vscode diff --git a/scripts/preprocess_spec.py b/scripts/preprocess_spec.py index 618b341224..ef99bc8dbf 100644 --- a/scripts/preprocess_spec.py +++ b/scripts/preprocess_spec.py @@ -102,7 +102,17 @@ def strip_tags_from_operation_id(operation, _): operation['operationId'] = operation_id +def add_thirdparty_resource_paths(spec): + with open('thirdpartypaths.json', 'r') as third_party_spec_file: + third_party_spec = json.loads(third_party_spec_file.read()) + for path in third_party_spec.keys(): + spec['paths'][path] = third_party_spec[path] + return spec + + def process_swagger(spec): + spec = add_thirdparty_resource_paths(spec) + apply_func_to_spec_operations(spec, strip_tags_from_operation_id) operation_ids = {} diff --git a/scripts/thirdpartypaths.json b/scripts/thirdpartypaths.json new file mode 100644 index 0000000000..71d3fe119b --- /dev/null +++ b/scripts/thirdpartypaths.json @@ -0,0 +1,251 @@ +{ + "/apis/{fqdn}/v1/{resource}": { + "get": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Gets Resources", + "description": "Returns a list of Resources", + "parameters": [ + { + "name": "watch", + "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.", + "in": "query" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + } + ], + "responses": { + "200": { + "description": "A list of Resources", + "schema": { + "type": "object" + } + } + } + } + }, + "/apis/{fqdn}/v1/namespaces/{namespace}/{resource}": { + "post": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Create a Resource", + "description": "Creates a third party resource of the type specified", + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The Resource's namespace", + "type": "string" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "description": "The JSON schema of the Resource to create.", + "schema": { + "type": "object" + } + } + ], + "responses": { + "201": { + "description": "A list of Resources", + "schema": { + "type": "object" + } + } + } + } + }, + "/apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name}": { + "get": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Gets a specific Resource", + "description": "Returns a specific Resource in a namespace", + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The Resource's namespace", + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "The Resource's name", + "type": "string" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + } + ], + "responses": { + "200": { + "description": "A single Resource", + "schema": { + "type": "object" + } + } + } + }, + "delete": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Deletes a specific Resource", + "description": "Deletes the specified Resource in the specified namespace", + "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" + } + } + } + }, + "put": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Replace a Resource", + "description": "Replaces the specified third party resource of the type specified", + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The Resource's namespace", + "type": "string" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "description": "The JSON schema of the Resource to create.", + "schema": { + "type": "object" + } + } + ], + "responses": { + "201": { + "description": "A list of Resources", + "schema": { + "type": "object" + } + } + } + } + } +} \ No newline at end of file From 3604c2af777bf19e0ca11c37b6d9e6da140bfd87 Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Tue, 9 May 2017 07:06:28 +0300 Subject: [PATCH 2/8] new line --- scripts/thirdpartypaths.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/thirdpartypaths.json b/scripts/thirdpartypaths.json index 71d3fe119b..229027743b 100644 --- a/scripts/thirdpartypaths.json +++ b/scripts/thirdpartypaths.json @@ -248,4 +248,4 @@ } } } -} \ No newline at end of file +} From 2e2431a1da7a4c975d3773ee0dc59477668854a5 Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Tue, 9 May 2017 07:02:17 +0300 Subject: [PATCH 3/8] Add support for thirdparty resource watch/create/put and delete operations --- .gitignore | 1 + scripts/preprocess_spec.py | 10 ++ scripts/thirdpartypaths.json | 251 +++++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+) create mode 100644 scripts/thirdpartypaths.json diff --git a/.gitignore b/.gitignore index 4bbc6b206e..bdd5055d15 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,4 @@ target/ # Intellij IDEA files .idea/* *.iml +.vscode diff --git a/scripts/preprocess_spec.py b/scripts/preprocess_spec.py index 618b341224..ef99bc8dbf 100644 --- a/scripts/preprocess_spec.py +++ b/scripts/preprocess_spec.py @@ -102,7 +102,17 @@ def strip_tags_from_operation_id(operation, _): operation['operationId'] = operation_id +def add_thirdparty_resource_paths(spec): + with open('thirdpartypaths.json', 'r') as third_party_spec_file: + third_party_spec = json.loads(third_party_spec_file.read()) + for path in third_party_spec.keys(): + spec['paths'][path] = third_party_spec[path] + return spec + + def process_swagger(spec): + spec = add_thirdparty_resource_paths(spec) + apply_func_to_spec_operations(spec, strip_tags_from_operation_id) operation_ids = {} diff --git a/scripts/thirdpartypaths.json b/scripts/thirdpartypaths.json new file mode 100644 index 0000000000..229027743b --- /dev/null +++ b/scripts/thirdpartypaths.json @@ -0,0 +1,251 @@ +{ + "/apis/{fqdn}/v1/{resource}": { + "get": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Gets Resources", + "description": "Returns a list of Resources", + "parameters": [ + { + "name": "watch", + "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.", + "in": "query" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + } + ], + "responses": { + "200": { + "description": "A list of Resources", + "schema": { + "type": "object" + } + } + } + } + }, + "/apis/{fqdn}/v1/namespaces/{namespace}/{resource}": { + "post": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Create a Resource", + "description": "Creates a third party resource of the type specified", + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The Resource's namespace", + "type": "string" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "description": "The JSON schema of the Resource to create.", + "schema": { + "type": "object" + } + } + ], + "responses": { + "201": { + "description": "A list of Resources", + "schema": { + "type": "object" + } + } + } + } + }, + "/apis/{fqdn}/v1/namespaces/{namespace}/{resource}/{name}": { + "get": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Gets a specific Resource", + "description": "Returns a specific Resource in a namespace", + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The Resource's namespace", + "type": "string" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "The Resource's name", + "type": "string" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + } + ], + "responses": { + "200": { + "description": "A single Resource", + "schema": { + "type": "object" + } + } + } + }, + "delete": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Deletes a specific Resource", + "description": "Deletes the specified Resource in the specified namespace", + "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" + } + } + } + }, + "put": { + "security": [ + { + "Bearer": [ + + ] + } + ], + "summary": "Replace a Resource", + "description": "Replaces the specified third party resource of the type specified", + "parameters": [ + { + "name": "namespace", + "in": "path", + "required": true, + "description": "The Resource's namespace", + "type": "string" + }, + { + "name": "fqdn", + "in": "path", + "required": true, + "description": "The Third party Resource fqdn", + "type": "string" + }, + { + "name": "resource", + "in": "path", + "required": true, + "description": "The Resource type", + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "description": "The JSON schema of the Resource to create.", + "schema": { + "type": "object" + } + } + ], + "responses": { + "201": { + "description": "A list of Resources", + "schema": { + "type": "object" + } + } + } + } + } +} From 5d5d094d98785a193b59ad569b9d1687760ba3da Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Thu, 11 May 2017 07:58:41 +0300 Subject: [PATCH 4/8] added validation and tagging --- examples/create_thirdparty_resource.py | 27 ++++++++++++++++++++++++++ scripts/preprocess_spec.py | 3 ++- scripts/thirdpartypaths.json | 17 +++++++++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 examples/create_thirdparty_resource.py diff --git a/examples/create_thirdparty_resource.py b/examples/create_thirdparty_resource.py new file mode 100644 index 0000000000..96b91f7ab1 --- /dev/null +++ b/examples/create_thirdparty_resource.py @@ -0,0 +1,27 @@ +from __future__ import print_function +import time +import kube_resource +import json +from kube_resource.rest import ApiException +from pprint import pprint + +with open('/var/run/secrets/kubernetes.io/serviceaccount/token', 'r') as token_file: + token=token_file.read() + +kube_resource.configuration.api_key['Authorization'] = token +kube_resource.configuration.api_key_prefix['Authorization'] = 'Bearer' +kube_resource.configuration.ssl_ca_cert = '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt' +api_instance = kube_resource.DefaultApi() + +namespace = 'default' +resource = 'repos' +fqdn = 'git.k8s.com' + +body = json.loads('{ "apiVersion": "git.k8s.com/v1", "kind": "RePo", "metadata": { "name": "blog-repo" }, "repo": "github.com/user/my-blog", "oauth": 123456789, "branch": "master", "key": "user-git-deploy-secret", "path": "/path/in/volume", "image": "image to run job in", "then": "hugo --destination=/home/user/hugosite/public", "pvc": "persistent-volume-claim", "username": "repo username", "password": "repo password"}') + +try: + # Create a Resource + api_response = api_instance.apis_fqdn_v1_namespaces_namespace_resource_post(namespace, fqdn, resource, body) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->apis_fqdn_v1_namespaces_namespace_resource_post: %s\n" % e) \ No newline at end of file diff --git a/scripts/preprocess_spec.py b/scripts/preprocess_spec.py index ef99bc8dbf..da53526115 100644 --- a/scripts/preprocess_spec.py +++ b/scripts/preprocess_spec.py @@ -106,7 +106,8 @@ def add_thirdparty_resource_paths(spec): with open('thirdpartypaths.json', 'r') as third_party_spec_file: third_party_spec = json.loads(third_party_spec_file.read()) for path in third_party_spec.keys(): - spec['paths'][path] = third_party_spec[path] + if path not in spec['paths'].keys(): + spec['paths'][path] = third_party_spec[path] return spec diff --git a/scripts/thirdpartypaths.json b/scripts/thirdpartypaths.json index 229027743b..44e4f4ba89 100644 --- a/scripts/thirdpartypaths.json +++ b/scripts/thirdpartypaths.json @@ -10,6 +10,9 @@ ], "summary": "Gets Resources", "description": "Returns a list of Resources", + "tags": [ + "thirdparty_v1" + ], "parameters": [ { "name": "watch", @@ -54,6 +57,9 @@ ], "summary": "Create a Resource", "description": "Creates a third party resource of the type specified", + "tags": [ + "thirdparty_v1" + ], "parameters": [ { "name": "namespace", @@ -107,6 +113,9 @@ ], "summary": "Gets a specific Resource", "description": "Returns a specific Resource in a namespace", + "tags": [ + "thirdparty_v1" + ], "parameters": [ { "name": "namespace", @@ -156,6 +165,9 @@ ], "summary": "Deletes a specific Resource", "description": "Deletes the specified Resource in the specified namespace", + "tags": [ + "thirdparty_v1" + ], "parameters": [ { "name": "body", @@ -206,6 +218,9 @@ ], "summary": "Replace a Resource", "description": "Replaces the specified third party resource of the type specified", + "tags": [ + "thirdparty_v1" + ], "parameters": [ { "name": "namespace", @@ -248,4 +263,4 @@ } } } -} +} \ No newline at end of file From b7668d5e44711b5e6661e9ba04e1118af9716cd0 Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Thu, 11 May 2017 08:21:46 +0300 Subject: [PATCH 5/8] fix example and tags - naming and pep --- examples/create_thirdparty_resource.py | 32 +++++++++++++++++--------- scripts/thirdpartypaths.json | 10 ++++---- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/examples/create_thirdparty_resource.py b/examples/create_thirdparty_resource.py index 96b91f7ab1..b771ca850a 100644 --- a/examples/create_thirdparty_resource.py +++ b/examples/create_thirdparty_resource.py @@ -1,27 +1,37 @@ from __future__ import print_function -import time -import kube_resource -import json -from kube_resource.rest import ApiException + +import kubernetes + +from kubernetes.rest import ApiException +from kubernetes import config from pprint import pprint with open('/var/run/secrets/kubernetes.io/serviceaccount/token', 'r') as token_file: token=token_file.read() -kube_resource.configuration.api_key['Authorization'] = token -kube_resource.configuration.api_key_prefix['Authorization'] = 'Bearer' -kube_resource.configuration.ssl_ca_cert = '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt' -api_instance = kube_resource.DefaultApi() +config.load_kube_config() +api_instance = kubernetes.ThirdPartyResources() namespace = 'default' resource = 'repos' fqdn = 'git.k8s.com' -body = json.loads('{ "apiVersion": "git.k8s.com/v1", "kind": "RePo", "metadata": { "name": "blog-repo" }, "repo": "github.com/user/my-blog", "oauth": 123456789, "branch": "master", "key": "user-git-deploy-secret", "path": "/path/in/volume", "image": "image to run job in", "then": "hugo --destination=/home/user/hugosite/public", "pvc": "persistent-volume-claim", "username": "repo username", "password": "repo password"}') +body = {} +body['apiVersion'] = "git.k8s.com/v1" +body['kind'] = "RePo" +body['metadata'] = {} +body['metadata']['name'] = "blog-repo" +body['repo'] = "github.com/user/my-blog" +body['username'] = "username" +body['password'] = "password" +body['branch'] = "branch" try: # Create a Resource - api_response = api_instance.apis_fqdn_v1_namespaces_namespace_resource_post(namespace, fqdn, resource, body) + api_response = api_instance.apis_fqdn_v1_namespaces_namespace_resource_post( + namespace, fqdn, resource, body) pprint(api_response) except ApiException as e: - print("Exception when calling DefaultApi->apis_fqdn_v1_namespaces_namespace_resource_post: %s\n" % e) \ No newline at end of file + print( + "Exception when calling DefaultApi->apis_fqdn_v1_namespaces_namespace_resource_post: %s\n" % + e) diff --git a/scripts/thirdpartypaths.json b/scripts/thirdpartypaths.json index 44e4f4ba89..5dd01f4ccc 100644 --- a/scripts/thirdpartypaths.json +++ b/scripts/thirdpartypaths.json @@ -11,7 +11,7 @@ "summary": "Gets Resources", "description": "Returns a list of Resources", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -58,7 +58,7 @@ "summary": "Create a Resource", "description": "Creates a third party resource of the type specified", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -114,7 +114,7 @@ "summary": "Gets a specific Resource", "description": "Returns a specific Resource in a namespace", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -166,7 +166,7 @@ "summary": "Deletes a specific Resource", "description": "Deletes the specified Resource in the specified namespace", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -219,7 +219,7 @@ "summary": "Replace a Resource", "description": "Replaces the specified third party resource of the type specified", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { From 6c4ff8dd72d0b9b932a2f7b21f7484da97a0994e Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Thu, 11 May 2017 08:21:46 +0300 Subject: [PATCH 6/8] fix example and tags - naming and pep --- examples/create_thirdparty_resource.py | 34 +++++++++++++++----------- scripts/thirdpartypaths.json | 10 ++++---- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/examples/create_thirdparty_resource.py b/examples/create_thirdparty_resource.py index 96b91f7ab1..2c28226caa 100644 --- a/examples/create_thirdparty_resource.py +++ b/examples/create_thirdparty_resource.py @@ -1,27 +1,33 @@ from __future__ import print_function -import time -import kube_resource -import json -from kube_resource.rest import ApiException from pprint import pprint +import kubernetes +from kubernetes import config +from kubernetes.rest import ApiException -with open('/var/run/secrets/kubernetes.io/serviceaccount/token', 'r') as token_file: - token=token_file.read() - -kube_resource.configuration.api_key['Authorization'] = token -kube_resource.configuration.api_key_prefix['Authorization'] = 'Bearer' -kube_resource.configuration.ssl_ca_cert = '/var/run/secrets/kubernetes.io/serviceaccount/ca.crt' -api_instance = kube_resource.DefaultApi() +config.load_kube_config() +api_instance = kubernetes.ThirdPartyResources() namespace = 'default' resource = 'repos' fqdn = 'git.k8s.com' -body = json.loads('{ "apiVersion": "git.k8s.com/v1", "kind": "RePo", "metadata": { "name": "blog-repo" }, "repo": "github.com/user/my-blog", "oauth": 123456789, "branch": "master", "key": "user-git-deploy-secret", "path": "/path/in/volume", "image": "image to run job in", "then": "hugo --destination=/home/user/hugosite/public", "pvc": "persistent-volume-claim", "username": "repo username", "password": "repo password"}') +body = {} +body['apiVersion'] = "git.k8s.com/v1" +body['kind'] = "RePo" +body['metadata'] = {} +body['metadata']['name'] = "blog-repo" +body['repo'] = "github.com/user/my-blog" +body['username'] = "username" +body['password'] = "password" +body['branch'] = "branch" + try: # Create a Resource - api_response = api_instance.apis_fqdn_v1_namespaces_namespace_resource_post(namespace, fqdn, resource, body) + api_response = api_instance.apis_fqdn_v1_namespaces_namespace_resource_post( + namespace, fqdn, resource, body) pprint(api_response) except ApiException as e: - print("Exception when calling DefaultApi->apis_fqdn_v1_namespaces_namespace_resource_post: %s\n" % e) \ No newline at end of file + print( + "Exception when calling DefaultApi->apis_fqdn_v1_namespaces_namespace_resource_post: %s\n" % + e) diff --git a/scripts/thirdpartypaths.json b/scripts/thirdpartypaths.json index 44e4f4ba89..5dd01f4ccc 100644 --- a/scripts/thirdpartypaths.json +++ b/scripts/thirdpartypaths.json @@ -11,7 +11,7 @@ "summary": "Gets Resources", "description": "Returns a list of Resources", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -58,7 +58,7 @@ "summary": "Create a Resource", "description": "Creates a third party resource of the type specified", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -114,7 +114,7 @@ "summary": "Gets a specific Resource", "description": "Returns a specific Resource in a namespace", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -166,7 +166,7 @@ "summary": "Deletes a specific Resource", "description": "Deletes the specified Resource in the specified namespace", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { @@ -219,7 +219,7 @@ "summary": "Replace a Resource", "description": "Replaces the specified third party resource of the type specified", "tags": [ - "thirdparty_v1" + "third_party_resources" ], "parameters": [ { From 631ab6302ffbecd4331d5c68ff6a3640d0f1be5b Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Thu, 11 May 2017 09:24:12 +0300 Subject: [PATCH 7/8] pep updates --- examples/create_thirdparty_resource.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/create_thirdparty_resource.py b/examples/create_thirdparty_resource.py index 2c28226caa..62b81efdcf 100644 --- a/examples/create_thirdparty_resource.py +++ b/examples/create_thirdparty_resource.py @@ -1,5 +1,7 @@ from __future__ import print_function + from pprint import pprint + import kubernetes from kubernetes import config from kubernetes.rest import ApiException @@ -22,6 +24,7 @@ body['branch'] = "branch" + try: # Create a Resource api_response = api_instance.apis_fqdn_v1_namespaces_namespace_resource_post( From ab98d0d6f9a5b04343ec5c2dc22d58c421a548b4 Mon Sep 17 00:00:00 2001 From: Jonathan Kosgei Date: Thu, 18 May 2017 09:21:26 +0300 Subject: [PATCH 8/8] pep fix --- ...e_thirdparty_resource.py => create_thirdparty_resource.md} | 4 ++++ 1 file changed, 4 insertions(+) rename examples/{create_thirdparty_resource.py => create_thirdparty_resource.md} (95%) diff --git a/examples/create_thirdparty_resource.py b/examples/create_thirdparty_resource.md similarity index 95% rename from examples/create_thirdparty_resource.py rename to examples/create_thirdparty_resource.md index 62b81efdcf..ec5975ad0a 100644 --- a/examples/create_thirdparty_resource.py +++ b/examples/create_thirdparty_resource.md @@ -1,3 +1,6 @@ +## Creating a Third Party Resource + +``` from __future__ import print_function from pprint import pprint @@ -34,3 +37,4 @@ print( "Exception when calling DefaultApi->apis_fqdn_v1_namespaces_namespace_resource_post: %s\n" % e) +``` \ No newline at end of file