Skip to content

Commit 1459df6

Browse files
Reznik V.DReznik V.D
Reznik V.D
authored and
Reznik V.D
committed
added cnpg_patch_cluster methods
1 parent d80165d commit 1459df6

File tree

1 file changed

+152
-0
lines changed

1 file changed

+152
-0
lines changed

Diff for: kubernetes/client/api/core_v1_api.py

+152
Original file line numberDiff line numberDiff line change
@@ -18866,6 +18866,158 @@ def patch_namespace_with_http_info(self, name, body, **kwargs): # noqa: E501
1886618866
_request_timeout=local_var_params.get('_request_timeout'),
1886718867
collection_formats=collection_formats)
1886818868

18869+
def patch_namespaced_cnpg_cluster_status(self, name, cluster_name, body, **kwargs): # noqa: E501
18870+
"""patch_namespace_status # noqa: E501
18871+
partially update status of the specified Namespace # noqa: E501
18872+
# Not allowed!
18873+
# This method makes a synchronous HTTP request by default. To make an
18874+
# asynchronous HTTP request, please pass async_req=True
18875+
# >>> thread = api.patch_namespace_status(name, body, async_req=True)
18876+
# >>> result = thread.get()
18877+
18878+
:param async_req bool: execute request asynchronously
18879+
:param str name: name of the Namespace (required)
18880+
:param str cluster_name: name of the Cluster (required)
18881+
:param object body: (required)
18882+
:param str pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).
18883+
:param str dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
18884+
:param str field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
18885+
:param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
18886+
:param bool force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
18887+
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.
18888+
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
18889+
18890+
:return: V1Namespace
18891+
18892+
If the method is called asynchronously, returns the request thread.
18893+
"""
18894+
18895+
kwargs['_return_http_data_only'] = True
18896+
18897+
return self.patch_namespaced_cnpg_cluster_status_with_http_info(name, cluster_name, body, **kwargs) # noqa: E501
18898+
18899+
def patch_namespaced_cnpg_cluster_status_with_http_info(self, name, cluster_name, body, **kwargs):
18900+
"""patch_namespace_status # noqa: E501
18901+
partially update status of the specified Namespace # noqa: E501
18902+
# Not allowed!
18903+
# This method makes a synchronous HTTP request by default. To make an
18904+
# asynchronous HTTP request, please pass async_req=True
18905+
# >>> thread = api.patch_namespace_status(name, body, async_req=True)
18906+
# >>> result = thread.get()
18907+
18908+
:param async_req bool: execute request asynchronously
18909+
:param str name: name of the Namespace (required)
18910+
:param str cluster_name: name of the Cluster (required)
18911+
:param object body: (required)
18912+
:param str pretty: If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget).
18913+
:param str dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
18914+
:param str field_manager: fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).
18915+
:param str field_validation: fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
18916+
:param bool force: Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
18917+
:param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True.
18918+
:param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
18919+
18920+
:return: V1Namespace
18921+
18922+
If the method is called asynchronously, returns the request thread.
18923+
"""
18924+
18925+
local_var_params = locals()
18926+
all_params = [
18927+
'name',
18928+
'cluster_name',
18929+
'body',
18930+
'pretty',
18931+
'dry_run',
18932+
'field_manager',
18933+
'field_validation',
18934+
'force'
18935+
]
18936+
18937+
all_params.extend([
18938+
'async_req',
18939+
'_return_http_data_only',
18940+
'_preload_content',
18941+
'_request_timeout'
18942+
])
18943+
18944+
for key, val in six.iteritems(local_var_params['kwargs']):
18945+
if key not in all_params:
18946+
raise ApiTypeError(
18947+
"Got an unexpected keyword argument '%s'"
18948+
" to method patch_namespace_status" % key)
18949+
18950+
local_var_params[key] = val
18951+
del local_var_params['kwargs']
18952+
18953+
# verify the required parameter 'name' is set
18954+
if self.api_client.client_side_validation and ('name' not in local_var_params or # noqa: E501
18955+
local_var_params['name'] is None): # noqa: E501
18956+
raise ApiValueError("Missing the required parameter `name` when calling `patch_namespace_status`")
18957+
18958+
if self.api_client.client_side_validation and ('cluster_name' not in local_var_params or # noqa: E501
18959+
local_var_params['cluster_name'] is None): # noqa: E501
18960+
raise ApiValueError("Missing the required parameter `cluster_name` when calling `patch_namespace_status`") # noqa: E501
18961+
18962+
# verify the required parameter 'body' is set
18963+
if self.api_client.client_side_validation and ('body' not in local_var_params or # noqa: E501
18964+
local_var_params['body'] is None): # noqa: E501
18965+
raise ApiValueError("Missing the required parameter `body` when calling `patch_namespace_status`") # noqa: E501
18966+
18967+
collection_formats = {}
18968+
path_params = {}
18969+
18970+
if 'name' in local_var_params:
18971+
path_params['name'] = local_var_params['name']
18972+
if 'cluster_name' in local_var_params:
18973+
path_params['cluster_name'] = local_var_params['cluster_name'] # noqa: E501
18974+
18975+
query_params = []
18976+
if 'pretty' in local_var_params and local_var_params['pretty'] is not None: # noqa: E501
18977+
query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501
18978+
if 'dry_run' in local_var_params and local_var_params['dry_run'] is not None: # noqa: E501
18979+
query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501
18980+
if 'field_manager' in local_var_params and local_var_params['field_manager'] is not None: # noqa: E501
18981+
query_params.append(('fieldManager', local_var_params['field_manager'])) # noqa: E501
18982+
if 'field_validation' in local_var_params and local_var_params['field_validation'] is not None: # noqa: E501
18983+
query_params.append(('fieldValidation', local_var_params['field_validation'])) # noqa: E501
18984+
if 'force' in local_var_params and local_var_params['force'] is not None: # noqa: E501
18985+
query_params.append(('force', local_var_params['force'])) # noqa: E501
18986+
18987+
header_params = {}
18988+
form_params = []
18989+
local_var_files = {}
18990+
body_params = None
18991+
18992+
if 'body' in local_var_params:
18993+
body_params = local_var_params['body']
18994+
18995+
# HTTP header `Accept`
18996+
header_params['Accept'] = self.api_client.select_header_accept(
18997+
['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/cbor']) # noqa: E501
18998+
18999+
# HTTP header `Content-Type`
19000+
header_params['Content-Type'] = 'application/merge-patch+json'
19001+
19002+
# Authentication setting
19003+
auth_settings = ['BearerToken'] # noqa: E501
19004+
19005+
return self.api_client.call_api(
19006+
'/apis/postgresql.cnpg.io/v1/namespaces/{name}/clusters/{cluster_name}/status', 'PATCH',
19007+
path_params,
19008+
query_params,
19009+
header_params,
19010+
body=body_params,
19011+
post_params=form_params,
19012+
files=local_var_files,
19013+
response_type='object', # noqa: E501
19014+
auth_settings=auth_settings,
19015+
async_req=local_var_params.get('async_req'),
19016+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
19017+
_preload_content=local_var_params.get('_preload_content', True),
19018+
_request_timeout=local_var_params.get('_request_timeout'),
19019+
collection_formats=collection_formats)
19020+
1886919021
def patch_namespace_status(self, name, body, **kwargs): # noqa: E501
1887019022
"""patch_namespace_status # noqa: E501
1887119023

0 commit comments

Comments
 (0)