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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.kubernetes.client.openapi.ApiClientaddDefaultCookie(String key, String value) Adds the default cookie.io.kubernetes.client.openapi.ApiClientaddDefaultHeader(String key, String value) Adds the default header.okhttp3.CallbuildCall(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.RequestbuildRequest(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.RequestBodybuildRequestBodyFormEncoding(Map<String, Object> formParams) Builds the request body form encoding.okhttp3.RequestBodybuildRequestBodyMultipart(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.PatchOptionsGets the default patch options.<T> Tdeserialize(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> voidexecuteAsync(okhttp3.Call call, io.kubernetes.client.openapi.ApiCallback<T> callback) Execute async.<T> voidexecuteAsync(okhttp3.Call call, Type returnType, io.kubernetes.client.openapi.ApiCallback<T> callback) Execute async.io.kubernetes.client.openapi.auth.AuthenticationgetAuthentication(String authName) Gets the authentication.Gets the authentications.Gets the base path.intGets the connect timeout.Gets the date format.okhttp3.OkHttpClientGets the http client.io.kubernetes.client.openapi.JSONgetJSON()Gets the json.Gets the key managers.intGets the read timeout.Gets the ssl ca cert.Gets the temp folder path.intGets the write timeout.guessContentTypeFromFile(File file) Guess content type from file.<T> ThandleResponse(okhttp3.Response response, Type returnType) Handle response.booleanChecks if is debugging.booleanisJsonMime(String mime) Checks if is json mime.booleanChecks 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.voidprocessCookieParams(Map<String, String> cookieParams, okhttp3.Request.Builder reqBuilder) Process cookie params.voidprocessHeaderParams(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.RequestBodySerialize.voidsetAccessToken(String accessToken) Sets the access token.voidSets the api key.voidsetApiKeyPrefix(String apiKeyPrefix) Sets the api key prefix.io.kubernetes.client.openapi.ApiClientsetBasePath(String basePath) Sets the base path.io.kubernetes.client.openapi.ApiClientsetConnectTimeout(int connectionTimeout) Sets the connect timeout.io.kubernetes.client.openapi.ApiClientsetDateFormat(DateFormat dateFormat) Sets the date format.io.kubernetes.client.openapi.ApiClientsetDebugging(boolean debugging) Sets the debugging.io.kubernetes.client.openapi.ApiClientsetHttpClient(okhttp3.OkHttpClient newHttpClient) Sets the http client.io.kubernetes.client.openapi.ApiClientsetJSON(io.kubernetes.client.openapi.JSON json) Sets the JSON.io.kubernetes.client.openapi.ApiClientsetKeyManagers(KeyManager[] managers) Sets the key managers.io.kubernetes.client.openapi.ApiClientsetLenientOnJson(boolean lenientOnJson) Sets the lenient on json.io.kubernetes.client.openapi.ApiClientsetLocalDateFormat(DateTimeFormatter dateFormat) Sets the local date format.io.kubernetes.client.openapi.ApiClientsetOffsetDateTimeFormat(DateTimeFormatter dateFormat) Sets the offset date time format.voidsetPassword(String password) Sets the password.io.kubernetes.client.openapi.ApiClientsetReadTimeout(int readTimeout) Sets the read timeout.io.kubernetes.client.openapi.ApiClientsetSqlDateFormat(DateFormat dateFormat) Sets the sql date format.io.kubernetes.client.openapi.ApiClientsetSslCaCert(InputStream sslCaCert) Sets the ssl ca cert.io.kubernetes.client.openapi.ApiClientsetTempFolderPath(String tempFolderPath) Sets the temp folder path.io.kubernetes.client.openapi.ApiClientsetUserAgent(String userAgent) Sets the user agent.voidsetUsername(String username) Sets the username.io.kubernetes.client.openapi.ApiClientsetVerifyingSsl(boolean verifyingSsl) Sets the verifying ssl.io.kubernetes.client.openapi.ApiClientsetWriteTimeout(int writeTimeout) Sets the write timeout.toString()To string.voidupdateParamsForAuth(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:
getBasePathin classio.kubernetes.client.openapi.ApiClient- Returns:
- the base path
- See Also:
-
setBasePath
Sets the base path.- Overrides:
setBasePathin classio.kubernetes.client.openapi.ApiClient- Parameters:
basePath- the base path- Returns:
- the api client
- See Also:
-
getHttpClient
Gets the http client.- Overrides:
getHttpClientin classio.kubernetes.client.openapi.ApiClient- Returns:
- the http client
- See Also:
-
setHttpClient
Sets the http client.- Overrides:
setHttpClientin classio.kubernetes.client.openapi.ApiClient- Parameters:
newHttpClient- the new http client- Returns:
- the api client
- See Also:
-
getJSON
Gets the json.- Overrides:
getJSONin classio.kubernetes.client.openapi.ApiClient- Returns:
- the json
- See Also:
-
setJSON
Sets the JSON.- Overrides:
setJSONin classio.kubernetes.client.openapi.ApiClient- Parameters:
json- the json- Returns:
- the api client
- See Also:
-
isVerifyingSsl
Checks if is verifying ssl.- Overrides:
isVerifyingSslin classio.kubernetes.client.openapi.ApiClient- Returns:
- true, if is verifying ssl
- See Also:
-
setVerifyingSsl
Sets the verifying ssl.- Overrides:
setVerifyingSslin classio.kubernetes.client.openapi.ApiClient- Parameters:
verifyingSsl- the verifying ssl- Returns:
- the api client
- See Also:
-
getSslCaCert
Gets the ssl ca cert.- Overrides:
getSslCaCertin classio.kubernetes.client.openapi.ApiClient- Returns:
- the ssl ca cert
- See Also:
-
setSslCaCert
Sets the ssl ca cert.- Overrides:
setSslCaCertin classio.kubernetes.client.openapi.ApiClient- Parameters:
sslCaCert- the ssl ca cert- Returns:
- the api client
- See Also:
-
getKeyManagers
Gets the key managers.- Overrides:
getKeyManagersin classio.kubernetes.client.openapi.ApiClient- Returns:
- the key managers
- See Also:
-
setKeyManagers
Sets the key managers.- Overrides:
setKeyManagersin classio.kubernetes.client.openapi.ApiClient- Parameters:
managers- the managers- Returns:
- the api client
- See Also:
-
getDateFormat
Gets the date format.- Overrides:
getDateFormatin classio.kubernetes.client.openapi.ApiClient- Returns:
- the date format
- See Also:
-
setDateFormat
Sets the date format.- Overrides:
setDateFormatin classio.kubernetes.client.openapi.ApiClient- Parameters:
dateFormat- the date format- Returns:
- the api client
- See Also:
-
setSqlDateFormat
Sets the sql date format.- Overrides:
setSqlDateFormatin classio.kubernetes.client.openapi.ApiClient- Parameters:
dateFormat- the date format- Returns:
- the api client
- See Also:
-
setOffsetDateTimeFormat
Sets the offset date time format.- Overrides:
setOffsetDateTimeFormatin classio.kubernetes.client.openapi.ApiClient- Parameters:
dateFormat- the date format- Returns:
- the api client
- See Also:
-
setLocalDateFormat
Sets the local date format.- Overrides:
setLocalDateFormatin classio.kubernetes.client.openapi.ApiClient- Parameters:
dateFormat- the date format- Returns:
- the api client
- See Also:
-
setLenientOnJson
Sets the lenient on json.- Overrides:
setLenientOnJsonin classio.kubernetes.client.openapi.ApiClient- Parameters:
lenientOnJson- the lenient on json- Returns:
- the api client
- See Also:
-
getAuthentications
Gets the authentications.- Overrides:
getAuthenticationsin classio.kubernetes.client.openapi.ApiClient- Returns:
- the authentications
- See Also:
-
getAuthentication
Gets the authentication.- Overrides:
getAuthenticationin classio.kubernetes.client.openapi.ApiClient- Parameters:
authName- the auth name- Returns:
- the authentication
- See Also:
-
setUsername
Sets the username.- Overrides:
setUsernamein classio.kubernetes.client.openapi.ApiClient- Parameters:
username- the new username- See Also:
-
setPassword
Sets the password.- Overrides:
setPasswordin classio.kubernetes.client.openapi.ApiClient- Parameters:
password- the new password- See Also:
-
setApiKey
Sets the api key.- Overrides:
setApiKeyin classio.kubernetes.client.openapi.ApiClient- Parameters:
apiKey- the new api key- See Also:
-
setApiKeyPrefix
Sets the api key prefix.- Overrides:
setApiKeyPrefixin classio.kubernetes.client.openapi.ApiClient- Parameters:
apiKeyPrefix- the new api key prefix- See Also:
-
setAccessToken
Sets the access token.- Overrides:
setAccessTokenin classio.kubernetes.client.openapi.ApiClient- Parameters:
accessToken- the new access token- See Also:
-
setUserAgent
Sets the user agent.- Overrides:
setUserAgentin 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:
addDefaultHeaderin classio.kubernetes.client.openapi.ApiClient- Parameters:
key- the keyvalue- the value- Returns:
- the api client
- See Also:
-
addDefaultCookie
Adds the default cookie.- Overrides:
addDefaultCookiein classio.kubernetes.client.openapi.ApiClient- Parameters:
key- the keyvalue- the value- Returns:
- the api client
- See Also:
-
isDebugging
Checks if is debugging.- Overrides:
isDebuggingin classio.kubernetes.client.openapi.ApiClient- Returns:
- true, if is debugging
- See Also:
-
setDebugging
Sets the debugging.- Overrides:
setDebuggingin classio.kubernetes.client.openapi.ApiClient- Parameters:
debugging- the debugging- Returns:
- the api client
- See Also:
-
getTempFolderPath
Gets the temp folder path.- Overrides:
getTempFolderPathin classio.kubernetes.client.openapi.ApiClient- Returns:
- the temp folder path
- See Also:
-
setTempFolderPath
Sets the temp folder path.- Overrides:
setTempFolderPathin classio.kubernetes.client.openapi.ApiClient- Parameters:
tempFolderPath- the temp folder path- Returns:
- the api client
- See Also:
-
getConnectTimeout
Gets the connect timeout.- Overrides:
getConnectTimeoutin classio.kubernetes.client.openapi.ApiClient- Returns:
- the connect timeout
- See Also:
-
setConnectTimeout
Sets the connect timeout.- Overrides:
setConnectTimeoutin classio.kubernetes.client.openapi.ApiClient- Parameters:
connectionTimeout- the connection timeout- Returns:
- the api client
- See Also:
-
getReadTimeout
Gets the read timeout.- Overrides:
getReadTimeoutin classio.kubernetes.client.openapi.ApiClient- Returns:
- the read timeout
- See Also:
-
setReadTimeout
Sets the read timeout.- Overrides:
setReadTimeoutin classio.kubernetes.client.openapi.ApiClient- Parameters:
readTimeout- the read timeout- Returns:
- the api client
- See Also:
-
getWriteTimeout
Gets the write timeout.- Overrides:
getWriteTimeoutin classio.kubernetes.client.openapi.ApiClient- Returns:
- the write timeout
- See Also:
-
setWriteTimeout
Sets the write timeout.- Overrides:
setWriteTimeoutin classio.kubernetes.client.openapi.ApiClient- Parameters:
writeTimeout- the write timeout- Returns:
- the api client
- See Also:
-
parameterToString
Parameter to string.- Overrides:
parameterToStringin classio.kubernetes.client.openapi.ApiClient- Parameters:
param- the param- Returns:
- the string
- See Also:
-
parameterToPair
Parameter to pair.- Overrides:
parameterToPairin 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:
parameterToPairsin 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:
collectionPathParameterToStringin classio.kubernetes.client.openapi.ApiClient- Parameters:
collectionFormat- the collection formatvalue- the value- Returns:
- the string
- See Also:
-
sanitizeFilename
Sanitize filename.- Overrides:
sanitizeFilenamein classio.kubernetes.client.openapi.ApiClient- Parameters:
filename- the filename- Returns:
- the string
- See Also:
-
isJsonMime
Checks if is json mime.- Overrides:
isJsonMimein classio.kubernetes.client.openapi.ApiClient- Parameters:
mime- the mime- Returns:
- true, if is json mime
- See Also:
-
selectHeaderAccept
Select header accept.- Overrides:
selectHeaderAcceptin classio.kubernetes.client.openapi.ApiClient- Parameters:
accepts- the accepts- Returns:
- the string
- See Also:
-
selectHeaderContentType
Select header content type.- Overrides:
selectHeaderContentTypein classio.kubernetes.client.openapi.ApiClient- Parameters:
contentTypes- the content types- Returns:
- the string
- See Also:
-
escapeString
Escape string.- Overrides:
escapeStringin 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:
deserializein 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:
serializein 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:
downloadFileFromResponsein 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:
prepareDownloadFilein 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:
executein 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:
executein 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:
executeAsyncin 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:
executeAsyncin 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:
handleResponsein 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:
buildCallin 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:
buildRequestin 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:
buildUrlin 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:
processHeaderParamsin 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:
processCookieParamsin 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:
updateParamsForAuthin 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:
buildRequestBodyFormEncodingin classio.kubernetes.client.openapi.ApiClient- Parameters:
formParams- the form params- Returns:
- the request body
- See Also:
-
buildRequestBodyMultipart
Builds the request body multipart.- Overrides:
buildRequestBodyMultipartin classio.kubernetes.client.openapi.ApiClient- Parameters:
formParams- the form params- Returns:
- the request body
- See Also:
-
guessContentTypeFromFile
Guess content type from file.- Overrides:
guessContentTypeFromFilein classio.kubernetes.client.openapi.ApiClient- Parameters:
file- the file- Returns:
- the string
- See Also:
-