com.nutanix.net.java.client.api.VirtualSwitchNodeInfoApi Maven / Gradle / Ivy
Show all versions of networking-java-client Show documentation
package com.nutanix.net.java.client.api;
import com.nutanix.net.java.client.ApiClient;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.HashSet;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.util.UriComponentsBuilder;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
@javax.annotation.Generated(value = "com.nutanix.swagger.codegen.generators.JavaClientSDKGenerator", date = "2023-08-18T03:03:05.126Z[Etc/UTC]")@Component("com.nutanix.net.java.client.api.VirtualSwitchNodeInfoApi")
public class VirtualSwitchNodeInfoApi {
private ApiClient apiClient;
private final Set headersToSkip;
public VirtualSwitchNodeInfoApi() {
this(new ApiClient());
}
@Autowired
public VirtualSwitchNodeInfoApi(ApiClient apiClient) {
this.apiClient = apiClient;
this.headersToSkip = new HashSet<>(Arrays.asList("authorization", "cookie", "ntnx-request-id", "host", "user-agent"));
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Check to see whether a node in a cluster is a storage-only node or not
* 200 - Array of node UUIDs and boolean pairs, indicating whether the nodes are storage-only. Requires Prism Central >= pc.2022.9.
*
4XX - Client error response
*
5XX - Server error response
* @param xClusterId Prism Element Cluster UUID
* @param args Additional arguments
* @return com.nutanix.dp1.net.networking.v4.config.NodeSchedulableStatusApiResponse
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public com.nutanix.dp1.net.networking.v4.config.NodeSchedulableStatusApiResponse getNodeSchedulableStatus(String xClusterId, HashMap ... args) throws RestClientException {
// Check for optional argument map
HashMap argMap = args.length > 0 ? args[0] : new HashMap();
Object postBody = null;
String path = UriComponentsBuilder.fromPath("/api/networking/v4.0.b1/config/node-schedulable-status").build().toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
if (xClusterId != null)
headerParams.add("X-Cluster-Id", apiClient.parameterToString(xClusterId));
argMap.forEach((key, value) -> {
if (!this.headersToSkip.contains(key.toLowerCase())) {
String stringValue = apiClient.parameterToString(value);
if (stringValue != null && !stringValue.trim().isEmpty()) {
headerParams.add(key, apiClient.parameterToString(value));
}
}
});
final String[] accepts = {
"application/json"
};
final List accept = apiClient.selectHeaderAccept(accepts);
final String[] contentTypes = { };
final MediaType contentType = apiClient.selectHeaderContentType(contentTypes);
String[] authNames = new String[] { "basicAuthScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
}