# frozen_string_literal: true # #Kubernetes # # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # # The version of the OpenAPI document: unversioned # # Generated by: https://openapi-generator.tech # OpenAPI Generator version: 6.5.0-SNAPSHOT # require 'cgi' module Zilla class DiscoveryV1Api attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # create an EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param body [IoK8sApiDiscoveryV1EndpointSlice] # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [String] :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. # @option opts [String] :field_validation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. 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 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - 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 when the `ServerSideFieldValidation` feature gate is enabled. - 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. # @return [IoK8sApiDiscoveryV1EndpointSlice] def create_discovery_v1_namespaced_endpoint_slice(namespace, body, opts = {}) data, _status_code, _headers = create_discovery_v1_namespaced_endpoint_slice_with_http_info(namespace, body, opts) data end # create an EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param body [IoK8sApiDiscoveryV1EndpointSlice] # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [String] :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. # @option opts [String] :field_validation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. 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 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - 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 when the `ServerSideFieldValidation` feature gate is enabled. - 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. # @return [Array<(IoK8sApiDiscoveryV1EndpointSlice, Integer, Hash)>] IoK8sApiDiscoveryV1EndpointSlice data, response status code and response headers def create_discovery_v1_namespaced_endpoint_slice_with_http_info(namespace, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.create_discovery_v1_namespaced_endpoint_slice ...' end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.create_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? raise ArgumentError, "Missing the required parameter 'body' when calling DiscoveryV1Api.create_discovery_v1_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices'.sub('{namespace}', CGI.escape(namespace.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:dryRun] = opts[:dry_run] unless opts[:dry_run].nil? query_params[:fieldManager] = opts[:field_manager] unless opts[:field_manager].nil? query_params[:fieldValidation] = opts[:field_validation] unless opts[:field_validation].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'IoK8sApiDiscoveryV1EndpointSlice' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.create_discovery_v1_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#create_discovery_v1_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # delete collection of EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :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 # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [Integer] :grace_period_seconds 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. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [Boolean] :orphan_dependents 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. # @option opts [String] :propagation_policy 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. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [IoK8sApimachineryPkgApisMetaV1DeleteOptions] :body # @return [IoK8sApimachineryPkgApisMetaV1Status] def delete_discovery_v1_collection_namespaced_endpoint_slice(namespace, opts = {}) data, _status_code, _headers = delete_discovery_v1_collection_namespaced_endpoint_slice_with_http_info(namespace, opts) data end # delete collection of EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :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 # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [Integer] :grace_period_seconds 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. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [Boolean] :orphan_dependents 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. # @option opts [String] :propagation_policy 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. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [IoK8sApimachineryPkgApisMetaV1DeleteOptions] :body # @return [Array<(IoK8sApimachineryPkgApisMetaV1Status, Integer, Hash)>] IoK8sApimachineryPkgApisMetaV1Status data, response status code and response headers def delete_discovery_v1_collection_namespaced_endpoint_slice_with_http_info(namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.delete_discovery_v1_collection_namespaced_endpoint_slice ...' end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.delete_discovery_v1_collection_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices'.sub('{namespace}', CGI.escape(namespace.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:continue] = opts[:continue] unless opts[:continue].nil? query_params[:dryRun] = opts[:dry_run] unless opts[:dry_run].nil? query_params[:fieldSelector] = opts[:field_selector] unless opts[:field_selector].nil? query_params[:gracePeriodSeconds] = opts[:grace_period_seconds] unless opts[:grace_period_seconds].nil? query_params[:labelSelector] = opts[:label_selector] unless opts[:label_selector].nil? query_params[:limit] = opts[:limit] unless opts[:limit].nil? query_params[:orphanDependents] = opts[:orphan_dependents] unless opts[:orphan_dependents].nil? query_params[:propagationPolicy] = opts[:propagation_policy] unless opts[:propagation_policy].nil? query_params[:resourceVersion] = opts[:resource_version] unless opts[:resource_version].nil? query_params[:resourceVersionMatch] = opts[:resource_version_match] unless opts[:resource_version_match].nil? query_params[:timeoutSeconds] = opts[:timeout_seconds] unless opts[:timeout_seconds].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:body]) # return_type return_type = opts[:debug_return_type] || 'IoK8sApimachineryPkgApisMetaV1Status' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.delete_discovery_v1_collection_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#delete_discovery_v1_collection_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # delete an EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [Integer] :grace_period_seconds 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. # @option opts [Boolean] :orphan_dependents 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. # @option opts [String] :propagation_policy 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. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. # @option opts [IoK8sApimachineryPkgApisMetaV1DeleteOptions] :body # @return [IoK8sApimachineryPkgApisMetaV1Status] def delete_discovery_v1_namespaced_endpoint_slice(name, namespace, opts = {}) data, _status_code, _headers = delete_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, opts) data end # delete an EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [Integer] :grace_period_seconds 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. # @option opts [Boolean] :orphan_dependents 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. # @option opts [String] :propagation_policy 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. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. # @option opts [IoK8sApimachineryPkgApisMetaV1DeleteOptions] :body # @return [Array<(IoK8sApimachineryPkgApisMetaV1Status, Integer, Hash)>] IoK8sApimachineryPkgApisMetaV1Status data, response status code and response headers def delete_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.delete_discovery_v1_namespaced_endpoint_slice ...' end # verify the required parameter 'name' is set if @api_client.config.client_side_validation && name.nil? raise ArgumentError, "Missing the required parameter 'name' when calling DiscoveryV1Api.delete_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.delete_discovery_v1_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'.sub('{name}', CGI.escape(name.to_s)).sub( '{namespace}', CGI.escape(namespace.to_s) ) # query parameters query_params = opts[:query_params] || {} query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:dryRun] = opts[:dry_run] unless opts[:dry_run].nil? query_params[:gracePeriodSeconds] = opts[:grace_period_seconds] unless opts[:grace_period_seconds].nil? query_params[:orphanDependents] = opts[:orphan_dependents] unless opts[:orphan_dependents].nil? query_params[:propagationPolicy] = opts[:propagation_policy] unless opts[:propagation_policy].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:body]) # return_type return_type = opts[:debug_return_type] || 'IoK8sApimachineryPkgApisMetaV1Status' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.delete_discovery_v1_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#delete_discovery_v1_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # get available resources # @param [Hash] opts the optional parameters # @return [IoK8sApimachineryPkgApisMetaV1APIResourceList] def get_discovery_v1_api_resources(opts = {}) data, _status_code, _headers = get_discovery_v1_api_resources_with_http_info(opts) data end # get available resources # @param [Hash] opts the optional parameters # @return [Array<(IoK8sApimachineryPkgApisMetaV1APIResourceList, Integer, Hash)>] IoK8sApimachineryPkgApisMetaV1APIResourceList data, response status code and response headers def get_discovery_v1_api_resources_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.get_discovery_v1_api_resources ...' end # resource path local_var_path = '/apis/discovery.k8s.io/v1/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IoK8sApimachineryPkgApisMetaV1APIResourceList' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.get_discovery_v1_api_resources', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#get_discovery_v1_api_resources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # list or watch objects of kind EndpointSlice # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [IoK8sApiDiscoveryV1EndpointSliceList] def list_discovery_v1_endpoint_slice_for_all_namespaces(opts = {}) data, _status_code, _headers = list_discovery_v1_endpoint_slice_for_all_namespaces_with_http_info(opts) data end # list or watch objects of kind EndpointSlice # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [Array<(IoK8sApiDiscoveryV1EndpointSliceList, Integer, Hash)>] IoK8sApiDiscoveryV1EndpointSliceList data, response status code and response headers def list_discovery_v1_endpoint_slice_for_all_namespaces_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.list_discovery_v1_endpoint_slice_for_all_namespaces ...' end # resource path local_var_path = '/apis/discovery.k8s.io/v1/endpointslices' # query parameters query_params = opts[:query_params] || {} query_params[:allowWatchBookmarks] = opts[:allow_watch_bookmarks] unless opts[:allow_watch_bookmarks].nil? query_params[:continue] = opts[:continue] unless opts[:continue].nil? query_params[:fieldSelector] = opts[:field_selector] unless opts[:field_selector].nil? query_params[:labelSelector] = opts[:label_selector] unless opts[:label_selector].nil? query_params[:limit] = opts[:limit] unless opts[:limit].nil? query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:resourceVersion] = opts[:resource_version] unless opts[:resource_version].nil? query_params[:resourceVersionMatch] = opts[:resource_version_match] unless opts[:resource_version_match].nil? query_params[:timeoutSeconds] = opts[:timeout_seconds] unless opts[:timeout_seconds].nil? query_params[:watch] = opts[:watch] unless opts[:watch].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IoK8sApiDiscoveryV1EndpointSliceList' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.list_discovery_v1_endpoint_slice_for_all_namespaces', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#list_discovery_v1_endpoint_slice_for_all_namespaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # list or watch objects of kind EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [IoK8sApiDiscoveryV1EndpointSliceList] def list_discovery_v1_namespaced_endpoint_slice(namespace, opts = {}) data, _status_code, _headers = list_discovery_v1_namespaced_endpoint_slice_with_http_info(namespace, opts) data end # list or watch objects of kind EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [Array<(IoK8sApiDiscoveryV1EndpointSliceList, Integer, Hash)>] IoK8sApiDiscoveryV1EndpointSliceList data, response status code and response headers def list_discovery_v1_namespaced_endpoint_slice_with_http_info(namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.list_discovery_v1_namespaced_endpoint_slice ...' end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.list_discovery_v1_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices'.sub('{namespace}', CGI.escape(namespace.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:allowWatchBookmarks] = opts[:allow_watch_bookmarks] unless opts[:allow_watch_bookmarks].nil? query_params[:continue] = opts[:continue] unless opts[:continue].nil? query_params[:fieldSelector] = opts[:field_selector] unless opts[:field_selector].nil? query_params[:labelSelector] = opts[:label_selector] unless opts[:label_selector].nil? query_params[:limit] = opts[:limit] unless opts[:limit].nil? query_params[:resourceVersion] = opts[:resource_version] unless opts[:resource_version].nil? query_params[:resourceVersionMatch] = opts[:resource_version_match] unless opts[:resource_version_match].nil? query_params[:timeoutSeconds] = opts[:timeout_seconds] unless opts[:timeout_seconds].nil? query_params[:watch] = opts[:watch] unless opts[:watch].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IoK8sApiDiscoveryV1EndpointSliceList' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.list_discovery_v1_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#list_discovery_v1_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # partially update the specified EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [String] :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). # @option opts [String] :field_validation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. 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 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - 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 when the `ServerSideFieldValidation` feature gate is enabled. - 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. # @option opts [Boolean] :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. # @return [IoK8sApiDiscoveryV1EndpointSlice] def patch_discovery_v1_namespaced_endpoint_slice(name, namespace, body, opts = {}) data, _status_code, _headers = patch_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, body, opts) data end # partially update the specified EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param body [Object] # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [String] :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). # @option opts [String] :field_validation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. 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 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - 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 when the `ServerSideFieldValidation` feature gate is enabled. - 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. # @option opts [Boolean] :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. # @return [Array<(IoK8sApiDiscoveryV1EndpointSlice, Integer, Hash)>] IoK8sApiDiscoveryV1EndpointSlice data, response status code and response headers def patch_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.patch_discovery_v1_namespaced_endpoint_slice ...' end # verify the required parameter 'name' is set if @api_client.config.client_side_validation && name.nil? raise ArgumentError, "Missing the required parameter 'name' when calling DiscoveryV1Api.patch_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.patch_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? raise ArgumentError, "Missing the required parameter 'body' when calling DiscoveryV1Api.patch_discovery_v1_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'.sub('{name}', CGI.escape(name.to_s)).sub( '{namespace}', CGI.escape(namespace.to_s) ) # query parameters query_params = opts[:query_params] || {} query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:dryRun] = opts[:dry_run] unless opts[:dry_run].nil? query_params[:fieldManager] = opts[:field_manager] unless opts[:field_manager].nil? query_params[:fieldValidation] = opts[:field_validation] unless opts[:field_validation].nil? query_params[:force] = opts[:force] unless opts[:force].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json-patch+json', 'application/merge-patch+json', 'application/strategic-merge-patch+json', 'application/apply-patch+yaml']) header_params['Content-Type'] = content_type unless content_type.nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'IoK8sApiDiscoveryV1EndpointSlice' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.patch_discovery_v1_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#patch_discovery_v1_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # read the specified EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @return [IoK8sApiDiscoveryV1EndpointSlice] def read_discovery_v1_namespaced_endpoint_slice(name, namespace, opts = {}) data, _status_code, _headers = read_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, opts) data end # read the specified EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @return [Array<(IoK8sApiDiscoveryV1EndpointSlice, Integer, Hash)>] IoK8sApiDiscoveryV1EndpointSlice data, response status code and response headers def read_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.read_discovery_v1_namespaced_endpoint_slice ...' end # verify the required parameter 'name' is set if @api_client.config.client_side_validation && name.nil? raise ArgumentError, "Missing the required parameter 'name' when calling DiscoveryV1Api.read_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.read_discovery_v1_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'.sub('{name}', CGI.escape(name.to_s)).sub( '{namespace}', CGI.escape(namespace.to_s) ) # query parameters query_params = opts[:query_params] || {} query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IoK8sApiDiscoveryV1EndpointSlice' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.read_discovery_v1_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#read_discovery_v1_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # replace the specified EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param body [IoK8sApiDiscoveryV1EndpointSlice] # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [String] :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. # @option opts [String] :field_validation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. 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 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - 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 when the `ServerSideFieldValidation` feature gate is enabled. - 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. # @return [IoK8sApiDiscoveryV1EndpointSlice] def replace_discovery_v1_namespaced_endpoint_slice(name, namespace, body, opts = {}) data, _status_code, _headers = replace_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, body, opts) data end # replace the specified EndpointSlice # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param body [IoK8sApiDiscoveryV1EndpointSlice] # @param [Hash] opts the optional parameters # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :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 # @option opts [String] :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. # @option opts [String] :field_validation fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields, provided that the `ServerSideFieldValidation` feature gate is also enabled. 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 and is the default behavior when the `ServerSideFieldValidation` feature gate is disabled. - 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 when the `ServerSideFieldValidation` feature gate is enabled. - 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. # @return [Array<(IoK8sApiDiscoveryV1EndpointSlice, Integer, Hash)>] IoK8sApiDiscoveryV1EndpointSlice data, response status code and response headers def replace_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.replace_discovery_v1_namespaced_endpoint_slice ...' end # verify the required parameter 'name' is set if @api_client.config.client_side_validation && name.nil? raise ArgumentError, "Missing the required parameter 'name' when calling DiscoveryV1Api.replace_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.replace_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? raise ArgumentError, "Missing the required parameter 'body' when calling DiscoveryV1Api.replace_discovery_v1_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'.sub('{name}', CGI.escape(name.to_s)).sub( '{namespace}', CGI.escape(namespace.to_s) ) # query parameters query_params = opts[:query_params] || {} query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:dryRun] = opts[:dry_run] unless opts[:dry_run].nil? query_params[:fieldManager] = opts[:field_manager] unless opts[:field_manager].nil? query_params[:fieldValidation] = opts[:field_validation] unless opts[:field_validation].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:debug_return_type] || 'IoK8sApiDiscoveryV1EndpointSlice' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.replace_discovery_v1_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#replace_discovery_v1_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # watch individual changes to a list of EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead. # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [IoK8sApimachineryPkgApisMetaV1WatchEvent] def watch_discovery_v1_endpoint_slice_list_for_all_namespaces(opts = {}) data, _status_code, _headers = watch_discovery_v1_endpoint_slice_list_for_all_namespaces_with_http_info(opts) data end # watch individual changes to a list of EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead. # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [Array<(IoK8sApimachineryPkgApisMetaV1WatchEvent, Integer, Hash)>] IoK8sApimachineryPkgApisMetaV1WatchEvent data, response status code and response headers def watch_discovery_v1_endpoint_slice_list_for_all_namespaces_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.watch_discovery_v1_endpoint_slice_list_for_all_namespaces ...' end # resource path local_var_path = '/apis/discovery.k8s.io/v1/watch/endpointslices' # query parameters query_params = opts[:query_params] || {} query_params[:allowWatchBookmarks] = opts[:allow_watch_bookmarks] unless opts[:allow_watch_bookmarks].nil? query_params[:continue] = opts[:continue] unless opts[:continue].nil? query_params[:fieldSelector] = opts[:field_selector] unless opts[:field_selector].nil? query_params[:labelSelector] = opts[:label_selector] unless opts[:label_selector].nil? query_params[:limit] = opts[:limit] unless opts[:limit].nil? query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:resourceVersion] = opts[:resource_version] unless opts[:resource_version].nil? query_params[:resourceVersionMatch] = opts[:resource_version_match] unless opts[:resource_version_match].nil? query_params[:timeoutSeconds] = opts[:timeout_seconds] unless opts[:timeout_seconds].nil? query_params[:watch] = opts[:watch] unless opts[:watch].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IoK8sApimachineryPkgApisMetaV1WatchEvent' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.watch_discovery_v1_endpoint_slice_list_for_all_namespaces', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#watch_discovery_v1_endpoint_slice_list_for_all_namespaces\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # watch changes to an object of kind EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter. # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [IoK8sApimachineryPkgApisMetaV1WatchEvent] def watch_discovery_v1_namespaced_endpoint_slice(name, namespace, opts = {}) data, _status_code, _headers = watch_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, opts) data end # watch changes to an object of kind EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter. # @param name [String] name of the EndpointSlice # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [Array<(IoK8sApimachineryPkgApisMetaV1WatchEvent, Integer, Hash)>] IoK8sApimachineryPkgApisMetaV1WatchEvent data, response status code and response headers def watch_discovery_v1_namespaced_endpoint_slice_with_http_info(name, namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.watch_discovery_v1_namespaced_endpoint_slice ...' end # verify the required parameter 'name' is set if @api_client.config.client_side_validation && name.nil? raise ArgumentError, "Missing the required parameter 'name' when calling DiscoveryV1Api.watch_discovery_v1_namespaced_endpoint_slice" end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.watch_discovery_v1_namespaced_endpoint_slice" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/watch/namespaces/{namespace}/endpointslices/{name}'.sub('{name}', CGI.escape(name.to_s)).sub( '{namespace}', CGI.escape(namespace.to_s) ) # query parameters query_params = opts[:query_params] || {} query_params[:allowWatchBookmarks] = opts[:allow_watch_bookmarks] unless opts[:allow_watch_bookmarks].nil? query_params[:continue] = opts[:continue] unless opts[:continue].nil? query_params[:fieldSelector] = opts[:field_selector] unless opts[:field_selector].nil? query_params[:labelSelector] = opts[:label_selector] unless opts[:label_selector].nil? query_params[:limit] = opts[:limit] unless opts[:limit].nil? query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:resourceVersion] = opts[:resource_version] unless opts[:resource_version].nil? query_params[:resourceVersionMatch] = opts[:resource_version_match] unless opts[:resource_version_match].nil? query_params[:timeoutSeconds] = opts[:timeout_seconds] unless opts[:timeout_seconds].nil? query_params[:watch] = opts[:watch] unless opts[:watch].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IoK8sApimachineryPkgApisMetaV1WatchEvent' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.watch_discovery_v1_namespaced_endpoint_slice', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#watch_discovery_v1_namespaced_endpoint_slice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end # watch individual changes to a list of EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead. # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [IoK8sApimachineryPkgApisMetaV1WatchEvent] def watch_discovery_v1_namespaced_endpoint_slice_list(namespace, opts = {}) data, _status_code, _headers = watch_discovery_v1_namespaced_endpoint_slice_list_with_http_info(namespace, opts) data end # watch individual changes to a list of EndpointSlice. deprecated: use the 'watch' parameter with a list operation instead. # @param namespace [String] object name and auth scope, such as for teams and projects # @param [Hash] opts the optional parameters # @option opts [Boolean] :allow_watch_bookmarks allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. # @option opts [String] :continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. # @option opts [String] :field_selector A selector to restrict the list of returned objects by their fields. Defaults to everything. # @option opts [String] :label_selector A selector to restrict the list of returned objects by their labels. Defaults to everything. # @option opts [Integer] :limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. # @option opts [String] :pretty If 'true', then the output is pretty printed. # @option opts [String] :resource_version resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [String] :resource_version_match resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset # @option opts [Integer] :timeout_seconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. # @option opts [Boolean] :watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. # @return [Array<(IoK8sApimachineryPkgApisMetaV1WatchEvent, Integer, Hash)>] IoK8sApimachineryPkgApisMetaV1WatchEvent data, response status code and response headers def watch_discovery_v1_namespaced_endpoint_slice_list_with_http_info(namespace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DiscoveryV1Api.watch_discovery_v1_namespaced_endpoint_slice_list ...' end # verify the required parameter 'namespace' is set if @api_client.config.client_side_validation && namespace.nil? raise ArgumentError, "Missing the required parameter 'namespace' when calling DiscoveryV1Api.watch_discovery_v1_namespaced_endpoint_slice_list" end # resource path local_var_path = '/apis/discovery.k8s.io/v1/watch/namespaces/{namespace}/endpointslices'.sub( '{namespace}', CGI.escape(namespace.to_s) ) # query parameters query_params = opts[:query_params] || {} query_params[:allowWatchBookmarks] = opts[:allow_watch_bookmarks] unless opts[:allow_watch_bookmarks].nil? query_params[:continue] = opts[:continue] unless opts[:continue].nil? query_params[:fieldSelector] = opts[:field_selector] unless opts[:field_selector].nil? query_params[:labelSelector] = opts[:label_selector] unless opts[:label_selector].nil? query_params[:limit] = opts[:limit] unless opts[:limit].nil? query_params[:pretty] = opts[:pretty] unless opts[:pretty].nil? query_params[:resourceVersion] = opts[:resource_version] unless opts[:resource_version].nil? query_params[:resourceVersionMatch] = opts[:resource_version_match] unless opts[:resource_version_match].nil? query_params[:timeoutSeconds] = opts[:timeout_seconds] unless opts[:timeout_seconds].nil? query_params[:watch] = opts[:watch] unless opts[:watch].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IoK8sApimachineryPkgApisMetaV1WatchEvent' # auth_names auth_names = opts[:debug_auth_names] || ['BearerToken'] new_options = opts.merge( operation: :'DiscoveryV1Api.watch_discovery_v1_namespaced_endpoint_slice_list', header_params:, query_params:, form_params:, body: post_body, auth_names:, return_type: ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: DiscoveryV1Api#watch_discovery_v1_namespaced_endpoint_slice_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end [data, status_code, headers] end end end