Package org.jdrupes.vmoperator.common
Class K8sClient
java.lang.Object
io.kubernetes.client.openapi.ApiClient
org.jdrupes.vmoperator.common.K8sClient
A client with some additional properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionio.kubernetes.client.openapi.ApiClient
addDefaultCookie
(String key, String value) Adds the default cookie.io.kubernetes.client.openapi.ApiClient
addDefaultHeader
(String key, String value) Adds the default header.okhttp3.Call
buildCall
(String path, String method, List<io.kubernetes.client.openapi.Pair> queryParams, List<io.kubernetes.client.openapi.Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, io.kubernetes.client.openapi.ApiCallback callback) Builds the call.okhttp3.Request
buildRequest
(String path, String method, List<io.kubernetes.client.openapi.Pair> queryParams, List<io.kubernetes.client.openapi.Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, io.kubernetes.client.openapi.ApiCallback callback) Builds the request.okhttp3.RequestBody
buildRequestBodyFormEncoding
(Map<String, Object> formParams) Builds the request body form encoding.okhttp3.RequestBody
buildRequestBodyMultipart
(Map<String, Object> formParams) Builds the request body multipart.buildUrl
(String path, List<io.kubernetes.client.openapi.Pair> queryParams, List<io.kubernetes.client.openapi.Pair> collectionQueryParams) Builds the url.collectionPathParameterToString
(String collectionFormat, Collection value) Collection path parameter to string.io.kubernetes.client.util.generic.options.PatchOptions
Gets the default patch options.<T> T
deserialize
(okhttp3.Response response, Type returnType) Deserialize.downloadFileFromResponse
(okhttp3.Response response) Download file from response.escapeString
(String str) Escape string.<T> io.kubernetes.client.openapi.ApiResponse
<T> execute
(okhttp3.Call call) Execute.<T> io.kubernetes.client.openapi.ApiResponse
<T> Execute.<T> void
executeAsync
(okhttp3.Call call, io.kubernetes.client.openapi.ApiCallback<T> callback) Execute async.<T> void
executeAsync
(okhttp3.Call call, Type returnType, io.kubernetes.client.openapi.ApiCallback<T> callback) Execute async.io.kubernetes.client.openapi.auth.Authentication
getAuthentication
(String authName) Gets the authentication.Gets the authentications.Gets the base path.int
Gets the connect timeout.Gets the date format.okhttp3.OkHttpClient
Gets the http client.io.kubernetes.client.openapi.JSON
getJSON()
Gets the json.Gets the key managers.int
Gets the read timeout.Gets the ssl ca cert.Gets the temp folder path.int
Gets the write timeout.guessContentTypeFromFile
(File file) Guess content type from file.<T> T
handleResponse
(okhttp3.Response response, Type returnType) Handle response.boolean
Checks if is debugging.boolean
isJsonMime
(String mime) Checks if is json mime.boolean
Checks if is verifying ssl.List
<io.kubernetes.client.openapi.Pair> parameterToPair
(String name, Object value) Parameter to pair.List
<io.kubernetes.client.openapi.Pair> parameterToPairs
(String collectionFormat, String name, Collection value) Parameter to pairs.parameterToString
(Object param) Parameter to string.prepareDownloadFile
(okhttp3.Response response) Prepare download file.void
processCookieParams
(Map<String, String> cookieParams, okhttp3.Request.Builder reqBuilder) Process cookie params.void
processHeaderParams
(Map<String, String> headerParams, okhttp3.Request.Builder reqBuilder) Process header params.sanitizeFilename
(String filename) Sanitize filename.selectHeaderAccept
(String[] accepts) Select header accept.selectHeaderContentType
(String[] contentTypes) Select header content type.okhttp3.RequestBody
Serialize.void
setAccessToken
(String accessToken) Sets the access token.void
Sets the api key.void
setApiKeyPrefix
(String apiKeyPrefix) Sets the api key prefix.io.kubernetes.client.openapi.ApiClient
setBasePath
(String basePath) Sets the base path.io.kubernetes.client.openapi.ApiClient
setConnectTimeout
(int connectionTimeout) Sets the connect timeout.io.kubernetes.client.openapi.ApiClient
setDateFormat
(DateFormat dateFormat) Sets the date format.io.kubernetes.client.openapi.ApiClient
setDebugging
(boolean debugging) Sets the debugging.io.kubernetes.client.openapi.ApiClient
setHttpClient
(okhttp3.OkHttpClient newHttpClient) Sets the http client.io.kubernetes.client.openapi.ApiClient
setJSON
(io.kubernetes.client.openapi.JSON json) Sets the JSON.io.kubernetes.client.openapi.ApiClient
setKeyManagers
(KeyManager[] managers) Sets the key managers.io.kubernetes.client.openapi.ApiClient
setLenientOnJson
(boolean lenientOnJson) Sets the lenient on json.io.kubernetes.client.openapi.ApiClient
setLocalDateFormat
(DateTimeFormatter dateFormat) Sets the local date format.io.kubernetes.client.openapi.ApiClient
setOffsetDateTimeFormat
(DateTimeFormatter dateFormat) Sets the offset date time format.void
setPassword
(String password) Sets the password.io.kubernetes.client.openapi.ApiClient
setReadTimeout
(int readTimeout) Sets the read timeout.io.kubernetes.client.openapi.ApiClient
setSqlDateFormat
(DateFormat dateFormat) Sets the sql date format.io.kubernetes.client.openapi.ApiClient
setSslCaCert
(InputStream sslCaCert) Sets the ssl ca cert.io.kubernetes.client.openapi.ApiClient
setTempFolderPath
(String tempFolderPath) Sets the temp folder path.io.kubernetes.client.openapi.ApiClient
setUserAgent
(String userAgent) Sets the user agent.void
setUsername
(String username) Sets the username.io.kubernetes.client.openapi.ApiClient
setVerifyingSsl
(boolean verifyingSsl) Sets the verifying ssl.io.kubernetes.client.openapi.ApiClient
setWriteTimeout
(int writeTimeout) Sets the write timeout.toString()
To string.void
updateParamsForAuth
(String[] authNames, List<io.kubernetes.client.openapi.Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) Update params for auth.with
(io.kubernetes.client.util.generic.options.PatchOptions patchOptions) Changes the default patch options.
-
Constructor Details
-
K8sClient
Instantiates a new client.- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
defaultPatchOptions
Gets the default patch options.- Returns:
- the defaultPatchOptions
-
with
Changes the default patch options.- Parameters:
patchOptions
- the patch options- Returns:
- the client
-
getBasePath
Gets the base path.- Overrides:
getBasePath
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the base path
- See Also:
-
setBasePath
Sets the base path.- Overrides:
setBasePath
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
basePath
- the base path- Returns:
- the api client
- See Also:
-
getHttpClient
Gets the http client.- Overrides:
getHttpClient
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the http client
- See Also:
-
setHttpClient
Sets the http client.- Overrides:
setHttpClient
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
newHttpClient
- the new http client- Returns:
- the api client
- See Also:
-
getJSON
Gets the json.- Overrides:
getJSON
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the json
- See Also:
-
setJSON
Sets the JSON.- Overrides:
setJSON
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
json
- the json- Returns:
- the api client
- See Also:
-
isVerifyingSsl
Checks if is verifying ssl.- Overrides:
isVerifyingSsl
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- true, if is verifying ssl
- See Also:
-
setVerifyingSsl
Sets the verifying ssl.- Overrides:
setVerifyingSsl
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
verifyingSsl
- the verifying ssl- Returns:
- the api client
- See Also:
-
getSslCaCert
Gets the ssl ca cert.- Overrides:
getSslCaCert
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the ssl ca cert
- See Also:
-
setSslCaCert
Sets the ssl ca cert.- Overrides:
setSslCaCert
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
sslCaCert
- the ssl ca cert- Returns:
- the api client
- See Also:
-
getKeyManagers
Gets the key managers.- Overrides:
getKeyManagers
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the key managers
- See Also:
-
setKeyManagers
Sets the key managers.- Overrides:
setKeyManagers
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
managers
- the managers- Returns:
- the api client
- See Also:
-
getDateFormat
Gets the date format.- Overrides:
getDateFormat
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the date format
- See Also:
-
setDateFormat
Sets the date format.- Overrides:
setDateFormat
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
dateFormat
- the date format- Returns:
- the api client
- See Also:
-
setSqlDateFormat
Sets the sql date format.- Overrides:
setSqlDateFormat
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
dateFormat
- the date format- Returns:
- the api client
- See Also:
-
setOffsetDateTimeFormat
Sets the offset date time format.- Overrides:
setOffsetDateTimeFormat
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
dateFormat
- the date format- Returns:
- the api client
- See Also:
-
setLocalDateFormat
Sets the local date format.- Overrides:
setLocalDateFormat
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
dateFormat
- the date format- Returns:
- the api client
- See Also:
-
setLenientOnJson
Sets the lenient on json.- Overrides:
setLenientOnJson
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
lenientOnJson
- the lenient on json- Returns:
- the api client
- See Also:
-
getAuthentications
Gets the authentications.- Overrides:
getAuthentications
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the authentications
- See Also:
-
getAuthentication
Gets the authentication.- Overrides:
getAuthentication
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
authName
- the auth name- Returns:
- the authentication
- See Also:
-
setUsername
Sets the username.- Overrides:
setUsername
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
username
- the new username- See Also:
-
setPassword
Sets the password.- Overrides:
setPassword
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
password
- the new password- See Also:
-
setApiKey
Sets the api key.- Overrides:
setApiKey
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
apiKey
- the new api key- See Also:
-
setApiKeyPrefix
Sets the api key prefix.- Overrides:
setApiKeyPrefix
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
apiKeyPrefix
- the new api key prefix- See Also:
-
setAccessToken
Sets the access token.- Overrides:
setAccessToken
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
accessToken
- the new access token- See Also:
-
setUserAgent
Sets the user agent.- Overrides:
setUserAgent
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
userAgent
- the user agent- Returns:
- the api client
- See Also:
-
toString
To string. -
addDefaultHeader
Adds the default header.- Overrides:
addDefaultHeader
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
key
- the keyvalue
- the value- Returns:
- the api client
- See Also:
-
addDefaultCookie
Adds the default cookie.- Overrides:
addDefaultCookie
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
key
- the keyvalue
- the value- Returns:
- the api client
- See Also:
-
isDebugging
Checks if is debugging.- Overrides:
isDebugging
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- true, if is debugging
- See Also:
-
setDebugging
Sets the debugging.- Overrides:
setDebugging
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
debugging
- the debugging- Returns:
- the api client
- See Also:
-
getTempFolderPath
Gets the temp folder path.- Overrides:
getTempFolderPath
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the temp folder path
- See Also:
-
setTempFolderPath
Sets the temp folder path.- Overrides:
setTempFolderPath
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
tempFolderPath
- the temp folder path- Returns:
- the api client
- See Also:
-
getConnectTimeout
Gets the connect timeout.- Overrides:
getConnectTimeout
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the connect timeout
- See Also:
-
setConnectTimeout
Sets the connect timeout.- Overrides:
setConnectTimeout
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
connectionTimeout
- the connection timeout- Returns:
- the api client
- See Also:
-
getReadTimeout
Gets the read timeout.- Overrides:
getReadTimeout
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the read timeout
- See Also:
-
setReadTimeout
Sets the read timeout.- Overrides:
setReadTimeout
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
readTimeout
- the read timeout- Returns:
- the api client
- See Also:
-
getWriteTimeout
Gets the write timeout.- Overrides:
getWriteTimeout
in classio.kubernetes.client.openapi.ApiClient
- Returns:
- the write timeout
- See Also:
-
setWriteTimeout
Sets the write timeout.- Overrides:
setWriteTimeout
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
writeTimeout
- the write timeout- Returns:
- the api client
- See Also:
-
parameterToString
Parameter to string.- Overrides:
parameterToString
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
param
- the param- Returns:
- the string
- See Also:
-
parameterToPair
Parameter to pair.- Overrides:
parameterToPair
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
name
- the namevalue
- the value- Returns:
- the list
- See Also:
-
parameterToPairs
public List<io.kubernetes.client.openapi.Pair> parameterToPairs(String collectionFormat, String name, Collection value) Parameter to pairs.- Overrides:
parameterToPairs
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
collectionFormat
- the collection formatname
- the namevalue
- the value- Returns:
- the list
- See Also:
-
collectionPathParameterToString
Collection path parameter to string.- Overrides:
collectionPathParameterToString
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
collectionFormat
- the collection formatvalue
- the value- Returns:
- the string
- See Also:
-
sanitizeFilename
Sanitize filename.- Overrides:
sanitizeFilename
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
filename
- the filename- Returns:
- the string
- See Also:
-
isJsonMime
Checks if is json mime.- Overrides:
isJsonMime
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
mime
- the mime- Returns:
- true, if is json mime
- See Also:
-
selectHeaderAccept
Select header accept.- Overrides:
selectHeaderAccept
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
accepts
- the accepts- Returns:
- the string
- See Also:
-
selectHeaderContentType
Select header content type.- Overrides:
selectHeaderContentType
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
contentTypes
- the content types- Returns:
- the string
- See Also:
-
escapeString
Escape string.- Overrides:
escapeString
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
str
- the str- Returns:
- the string
- See Also:
-
deserialize
public <T> T deserialize(okhttp3.Response response, Type returnType) throws io.kubernetes.client.openapi.ApiException Deserialize.- Overrides:
deserialize
in classio.kubernetes.client.openapi.ApiClient
- Type Parameters:
T
- the generic type- Parameters:
response
- the responsereturnType
- the return type- Returns:
- the t
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
serialize
public okhttp3.RequestBody serialize(Object obj, String contentType) throws io.kubernetes.client.openapi.ApiException Serialize.- Overrides:
serialize
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
obj
- the objcontentType
- the content type- Returns:
- the request body
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
downloadFileFromResponse
public File downloadFileFromResponse(okhttp3.Response response) throws io.kubernetes.client.openapi.ApiException Download file from response.- Overrides:
downloadFileFromResponse
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
response
- the response- Returns:
- the file
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
prepareDownloadFile
Prepare download file.- Overrides:
prepareDownloadFile
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
response
- the response- Returns:
- the file
- Throws:
IOException
- Signals that an I/O exception has occurred.- See Also:
-
execute
public <T> io.kubernetes.client.openapi.ApiResponse<T> execute(okhttp3.Call call) throws io.kubernetes.client.openapi.ApiException Execute.- Overrides:
execute
in classio.kubernetes.client.openapi.ApiClient
- Type Parameters:
T
- the generic type- Parameters:
call
- the call- Returns:
- the api response
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
execute
public <T> io.kubernetes.client.openapi.ApiResponse<T> execute(okhttp3.Call call, Type returnType) throws io.kubernetes.client.openapi.ApiException Execute.- Overrides:
execute
in classio.kubernetes.client.openapi.ApiClient
- Type Parameters:
T
- the generic type- Parameters:
call
- the callreturnType
- the return type- Returns:
- the api response
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
executeAsync
public <T> void executeAsync(okhttp3.Call call, io.kubernetes.client.openapi.ApiCallback<T> callback) Execute async.- Overrides:
executeAsync
in classio.kubernetes.client.openapi.ApiClient
- Type Parameters:
T
- the generic type- Parameters:
call
- the callcallback
- the callback- See Also:
-
executeAsync
public <T> void executeAsync(okhttp3.Call call, Type returnType, io.kubernetes.client.openapi.ApiCallback<T> callback) Execute async.- Overrides:
executeAsync
in classio.kubernetes.client.openapi.ApiClient
- Type Parameters:
T
- the generic type- Parameters:
call
- the callreturnType
- the return typecallback
- the callback- See Also:
-
handleResponse
public <T> T handleResponse(okhttp3.Response response, Type returnType) throws io.kubernetes.client.openapi.ApiException Handle response.- Overrides:
handleResponse
in classio.kubernetes.client.openapi.ApiClient
- Type Parameters:
T
- the generic type- Parameters:
response
- the responsereturnType
- the return type- Returns:
- the t
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
buildCall
public okhttp3.Call buildCall(String path, String method, List<io.kubernetes.client.openapi.Pair> queryParams, List<io.kubernetes.client.openapi.Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, throws io.kubernetes.client.openapi.ApiExceptionString> cookieParams, Map<String, Object> formParams, String[] authNames, io.kubernetes.client.openapi.ApiCallback callback) Builds the call.- Overrides:
buildCall
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
path
- the pathmethod
- the methodqueryParams
- the query paramscollectionQueryParams
- the collection query paramsbody
- the bodyheaderParams
- the header paramscookieParams
- the cookie paramsformParams
- the form paramsauthNames
- the auth namescallback
- the callback- Returns:
- the call
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
buildRequest
public okhttp3.Request buildRequest(String path, String method, List<io.kubernetes.client.openapi.Pair> queryParams, List<io.kubernetes.client.openapi.Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, throws io.kubernetes.client.openapi.ApiExceptionString> cookieParams, Map<String, Object> formParams, String[] authNames, io.kubernetes.client.openapi.ApiCallback callback) Builds the request.- Overrides:
buildRequest
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
path
- the pathmethod
- the methodqueryParams
- the query paramscollectionQueryParams
- the collection query paramsbody
- the bodyheaderParams
- the header paramscookieParams
- the cookie paramsformParams
- the form paramsauthNames
- the auth namescallback
- the callback- Returns:
- the request
- Throws:
io.kubernetes.client.openapi.ApiException
- the api exception- See Also:
-
buildUrl
public String buildUrl(String path, List<io.kubernetes.client.openapi.Pair> queryParams, List<io.kubernetes.client.openapi.Pair> collectionQueryParams) Builds the url.- Overrides:
buildUrl
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
path
- the pathqueryParams
- the query paramscollectionQueryParams
- the collection query params- Returns:
- the string
- See Also:
-
processHeaderParams
public void processHeaderParams(Map<String, String> headerParams, okhttp3.Request.Builder reqBuilder) Process header params.- Overrides:
processHeaderParams
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
headerParams
- the header paramsreqBuilder
- the req builder- See Also:
-
processCookieParams
public void processCookieParams(Map<String, String> cookieParams, okhttp3.Request.Builder reqBuilder) Process cookie params.- Overrides:
processCookieParams
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
cookieParams
- the cookie paramsreqBuilder
- the req builder- See Also:
-
updateParamsForAuth
public void updateParamsForAuth(String[] authNames, List<io.kubernetes.client.openapi.Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams) Update params for auth.- Overrides:
updateParamsForAuth
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
authNames
- the auth namesqueryParams
- the query paramsheaderParams
- the header paramscookieParams
- the cookie params- See Also:
-
buildRequestBodyFormEncoding
Builds the request body form encoding.- Overrides:
buildRequestBodyFormEncoding
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
formParams
- the form params- Returns:
- the request body
- See Also:
-
buildRequestBodyMultipart
Builds the request body multipart.- Overrides:
buildRequestBodyMultipart
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
formParams
- the form params- Returns:
- the request body
- See Also:
-
guessContentTypeFromFile
Guess content type from file.- Overrides:
guessContentTypeFromFile
in classio.kubernetes.client.openapi.ApiClient
- Parameters:
file
- the file- Returns:
- the string
- See Also:
-