use of io.kubernetes.client.openapi.models.VersionInfo in project java by kubernetes-client.
the class VersionApi method getCodeAsync.
/**
* (asynchronously) get the code version
*
* @param _callback The callback to be executed when the API call finishes
* @return The request call
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
* @http.response.details
* <table summary="Response Details" border="1">
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
* </table>
*/
public okhttp3.Call getCodeAsync(final ApiCallback<VersionInfo> _callback) throws ApiException {
okhttp3.Call localVarCall = getCodeValidateBeforeCall(_callback);
Type localVarReturnType = new TypeToken<VersionInfo>() {
}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
use of io.kubernetes.client.openapi.models.VersionInfo in project java by kubernetes-client.
the class VersionTest method testFailure.
@Test
public void testFailure() throws InterruptedException, IOException, ApiException {
wireMockRule.stubFor(get(urlPathEqualTo("/version/")).willReturn(aResponse().withStatus(401).withHeader("Content-Type", "application/json").withBody("{}")));
Version versionUtil = new Version(client);
boolean thrown = false;
try {
VersionInfo versionInfo = versionUtil.getVersion();
} catch (ApiException ex) {
assertEquals(401, ex.getCode());
thrown = true;
}
assertEquals(thrown, true);
verify(getRequestedFor(urlPathEqualTo("/version/")).withHeader("Content-Type", equalTo("application/json")).withHeader("Accept", equalTo("application/json")));
}
use of io.kubernetes.client.openapi.models.VersionInfo in project java by kubernetes-client.
the class VersionTest method testUrl.
@Test
public void testUrl() throws InterruptedException, IOException, ApiException {
wireMockRule.stubFor(get(urlPathEqualTo("/version/")).willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody("{}")));
Version versionUtil = new Version(client);
try {
VersionInfo versionInfo = versionUtil.getVersion();
} catch (ApiException ex) {
}
verify(getRequestedFor(urlPathEqualTo("/version/")).withHeader("Content-Type", equalTo("application/json")).withHeader("Accept", equalTo("application/json")));
}
use of io.kubernetes.client.openapi.models.VersionInfo in project java by kubernetes-client.
the class VersionApi method getCodeWithHttpInfo.
/**
* get the code version
*
* @return ApiResponse<VersionInfo>
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
* response body
* @http.response.details
* <table summary="Response Details" border="1">
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
* </table>
*/
public ApiResponse<VersionInfo> getCodeWithHttpInfo() throws ApiException {
okhttp3.Call localVarCall = getCodeValidateBeforeCall(null);
Type localVarReturnType = new TypeToken<VersionInfo>() {
}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
Aggregations