Thanks to visit codestin.com
Credit goes to github.com

Skip to content

API change for v6.0.0b1 #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# v6.0.0b1
- Update to Kubernetes 1.10 cluster
- New API: add PATCH to CustomObjectsApi [kubernetes-client/gen#53](https://github.com/kubernetes-client/gen/pull/53)
- Documentation update: never let cluster-scoped resources skip webhooks [kubernetes/kubernetes#58185](https://github.com/kubernetes/kubernetes/pull/58185)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, are you manually generating this? I would be beneficial to all clients if we can automate this. I would create a tracking issue in gen repo for it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I manually checked the diff and tracked down the original PRs. It would help a lot if gen could detect the openapi spec change since last time we generated the client


# v5.0.0
- No changes. The same as `v5.0.0b1`.

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ supported versions of Kubernetes clusters.

#### Compatibility matrix

| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 |
|--------------------|----------------|----------------|----------------|----------------|----------------|----------------|
| client-python 1.0 | + | ✓ | - | - |- |- |
| client-python 2.0 | + | + | ✓ | - |- |- |
| client-python 3.0 | + | + | + | ✓ |- |- |
| client-python 4.0 | + | + | + | + |✓ |- |
| client-python 5.0 | + | + | + | + |+ |✓ |
| client-python HEAD | + | + | + | + |+ |✓ |
| | Kubernetes 1.4 | Kubernetes 1.5 | Kubernetes 1.6 | Kubernetes 1.7 | Kubernetes 1.8 | Kubernetes 1.9 | Kubernetes 1.10 |
|--------------------|----------------|----------------|----------------|----------------|----------------|----------------|-----------------|
| client-python 1.0 | + | ✓ | - | - |- |- | |
| client-python 2.0 | + | + | ✓ | - |- |- | |
| client-python 3.0 | + | + | + | ✓ |- |- | |
| client-python 4.0 | + | + | + | + |✓ |- | |
| client-python 5.0 | + | + | + | + |+ |✓ | |
| client-python 6.0 | + | + | + | + |+ |+ |✓ |
| client-python HEAD | + | + | + | + |+ |+ |✓ |

Key:

Expand All @@ -116,6 +117,7 @@ between client-python versions.
| 4.0 | Kubernetes main repo, 1.8 branch | ✓ |
| 5.0 Alpha/Beta | Kubernetes main repo, 1.9 branch | ✗ |
| 5.0 | Kubernetes main repo, 1.9 branch | ✓ |
| 6.0 Alpha/Beta | Kubernetes main repo, 1.10 branch | ✓ |


Key:
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ Class | Method | HTTP request | Description
*CustomObjectsApi* | [**get_namespaced_custom_object**](docs/CustomObjectsApi.md#get_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} |
*CustomObjectsApi* | [**list_cluster_custom_object**](docs/CustomObjectsApi.md#list_cluster_custom_object) | **GET** /apis/{group}/{version}/{plural} |
*CustomObjectsApi* | [**list_namespaced_custom_object**](docs/CustomObjectsApi.md#list_namespaced_custom_object) | **GET** /apis/{group}/{version}/namespaces/{namespace}/{plural} |
*CustomObjectsApi* | [**patch_cluster_custom_object**](docs/CustomObjectsApi.md#patch_cluster_custom_object) | **PATCH** /apis/{group}/{version}/{plural}/{name} |
*CustomObjectsApi* | [**patch_namespaced_custom_object**](docs/CustomObjectsApi.md#patch_namespaced_custom_object) | **PATCH** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} |
*CustomObjectsApi* | [**replace_cluster_custom_object**](docs/CustomObjectsApi.md#replace_cluster_custom_object) | **PUT** /apis/{group}/{version}/{plural}/{name} |
*CustomObjectsApi* | [**replace_namespaced_custom_object**](docs/CustomObjectsApi.md#replace_namespaced_custom_object) | **PUT** /apis/{group}/{version}/namespaces/{namespace}/{plural}/{name} |
*EventsApi* | [**get_api_group**](docs/EventsApi.md#get_api_group) | **GET** /apis/events.k8s.io/ |
Expand Down
255 changes: 255 additions & 0 deletions kubernetes/client/apis/custom_objects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,261 @@ def list_namespaced_custom_object_with_http_info(self, group, version, namespace
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def patch_cluster_custom_object(self, group, version, plural, name, body, **kwargs):
"""
patch the specified cluster scoped custom object
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.patch_cluster_custom_object(group, version, plural, name, body, async=True)
>>> result = thread.get()

:param async bool
:param str group: the custom resource's group (required)
:param str version: the custom resource's version (required)
:param str plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required)
:param str name: the custom object's name (required)
:param object body: The JSON schema of the Resource to patch. (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, **kwargs)
else:
(data) = self.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, **kwargs)
return data

def patch_cluster_custom_object_with_http_info(self, group, version, plural, name, body, **kwargs):
"""
patch the specified cluster scoped custom object
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.patch_cluster_custom_object_with_http_info(group, version, plural, name, body, async=True)
>>> result = thread.get()

:param async bool
:param str group: the custom resource's group (required)
:param str version: the custom resource's version (required)
:param str plural: the custom object's plural name. For TPRs this would be lowercase plural kind. (required)
:param str name: the custom object's name (required)
:param object body: The JSON schema of the Resource to patch. (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['group', 'version', 'plural', 'name', 'body']
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method patch_cluster_custom_object" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'group' is set
if ('group' not in params) or (params['group'] is None):
raise ValueError("Missing the required parameter `group` when calling `patch_cluster_custom_object`")
# verify the required parameter 'version' is set
if ('version' not in params) or (params['version'] is None):
raise ValueError("Missing the required parameter `version` when calling `patch_cluster_custom_object`")
# verify the required parameter 'plural' is set
if ('plural' not in params) or (params['plural'] is None):
raise ValueError("Missing the required parameter `plural` when calling `patch_cluster_custom_object`")
# verify the required parameter 'name' is set
if ('name' not in params) or (params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `patch_cluster_custom_object`")
# verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `patch_cluster_custom_object`")


collection_formats = {}

path_params = {}
if 'group' in params:
path_params['group'] = params['group']
if 'version' in params:
path_params['version'] = params['version']
if 'plural' in params:
path_params['plural'] = params['plural']
if 'name' in params:
path_params['name'] = params['name']

query_params = []

header_params = {}

form_params = []
local_var_files = {}

body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json'])

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/merge-patch+json'])

# Authentication setting
auth_settings = ['BearerToken']

return self.api_client.call_api('/apis/{group}/{version}/{plural}/{name}', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object',
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def patch_namespaced_custom_object(self, group, version, namespace, plural, name, body, **kwargs):
"""
patch the specified namespace scoped custom object
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.patch_namespaced_custom_object(group, version, namespace, plural, name, body, async=True)
>>> result = thread.get()

:param async bool
:param str group: the custom resource's group (required)
:param str version: the custom resource's version (required)
:param str namespace: The custom resource's namespace (required)
:param str plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required)
:param str name: the custom object's name (required)
:param object body: The JSON schema of the Resource to patch. (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return self.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, **kwargs)
else:
(data) = self.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, **kwargs)
return data

def patch_namespaced_custom_object_with_http_info(self, group, version, namespace, plural, name, body, **kwargs):
"""
patch the specified namespace scoped custom object
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.patch_namespaced_custom_object_with_http_info(group, version, namespace, plural, name, body, async=True)
>>> result = thread.get()

:param async bool
:param str group: the custom resource's group (required)
:param str version: the custom resource's version (required)
:param str namespace: The custom resource's namespace (required)
:param str plural: the custom resource's plural name. For TPRs this would be lowercase plural kind. (required)
:param str name: the custom object's name (required)
:param object body: The JSON schema of the Resource to patch. (required)
:return: object
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['group', 'version', 'namespace', 'plural', 'name', 'body']
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')

params = locals()
for key, val in iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method patch_namespaced_custom_object" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'group' is set
if ('group' not in params) or (params['group'] is None):
raise ValueError("Missing the required parameter `group` when calling `patch_namespaced_custom_object`")
# verify the required parameter 'version' is set
if ('version' not in params) or (params['version'] is None):
raise ValueError("Missing the required parameter `version` when calling `patch_namespaced_custom_object`")
# verify the required parameter 'namespace' is set
if ('namespace' not in params) or (params['namespace'] is None):
raise ValueError("Missing the required parameter `namespace` when calling `patch_namespaced_custom_object`")
# verify the required parameter 'plural' is set
if ('plural' not in params) or (params['plural'] is None):
raise ValueError("Missing the required parameter `plural` when calling `patch_namespaced_custom_object`")
# verify the required parameter 'name' is set
if ('name' not in params) or (params['name'] is None):
raise ValueError("Missing the required parameter `name` when calling `patch_namespaced_custom_object`")
# verify the required parameter 'body' is set
if ('body' not in params) or (params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `patch_namespaced_custom_object`")


collection_formats = {}

path_params = {}
if 'group' in params:
path_params['group'] = params['group']
if 'version' in params:
path_params['version'] = params['version']
if 'namespace' in params:
path_params['namespace'] = params['namespace']
if 'plural' in params:
path_params['plural'] = params['plural']
if 'name' in params:
path_params['name'] = params['name']

query_params = []

header_params = {}

form_params = []
local_var_files = {}

body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json'])

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['application/merge-patch+json'])

# Authentication setting
auth_settings = ['BearerToken']

return self.api_client.call_api('/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}', 'PATCH',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='object',
auth_settings=auth_settings,
async=params.get('async'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def replace_cluster_custom_object(self, group, version, plural, name, body, **kwargs):
"""
replace the specified cluster scoped custom object
Expand Down
Loading