com.nutanix.net.java.client.api.VpcNsStatsApi 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.HashMap;
import java.util.List;
import java.util.Map;
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-02-01T08:24:43.584Z[Etc/UTC]")@Component("com.nutanix.net.java.client.api.VpcNsStatsApi")
public class VpcNsStatsApi {
private ApiClient apiClient;
public VpcNsStatsApi() {
this(new ApiClient());
}
@Autowired
public VpcNsStatsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get VPC North-South statistics
* 200 - Get VPC North-South statistics response
*
4XX - Client error response
*
5XX - Server error response
* @param vpcUuid The UUID of the VPC.
* @param extSubnetUuid The UUID of the VPC.
* @param $startTime The start time of the period for which stats should be reported. The value should be in extended ISO-8601 format. For example, start time of 2022-04-23T01:23:45.678+09:00 would consider all stats starting at 1:23:45.678 on the 23rd of April 2022. Details around ISO-8601 format can be found at https://www.iso.org/standard/70907.html
* @param $endTime The end time of the period for which stats should be reported. The value should be in extended ISO-8601 format. For example, end time of 2022-04-23T013:23:45.678+09:00 would consider all stats till 13:23:45 .678 on the 23rd of April 2022. Details around ISO-8601 format can be found at https://www.iso.org/standard/70907.html
* @param $samplingInterval The sampling interval in seconds at which statistical data should be collected For example, do you want performance statistics every 30 seconds? Every 60 seconds?
* @param $statType The $statType parameter
* @param $select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e. *), then all properties on the matching resource will be returned.
- entityUuid
- extId
- links
- northSouthEgressBytesAbs
- northSouthEgressBytesPerSec
- northSouthEgressPacketsAbs
- northSouthEgressPacketsPerSec
- northSouthIngressBytesAbs
- northSouthIngressBytesPerSec
- northSouthIngressPacketsAbs
- northSouthIngressPacketsPerSec
- statType
- tenantId
* @param args Additional arguments
* @return com.nutanix.dp1.net.networking.v4.stats.VpcNsStatsApiResponse
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public com.nutanix.dp1.net.networking.v4.stats.VpcNsStatsApiResponse getVpcNsStats(String vpcUuid, String extSubnetUuid, String $startTime, String $endTime, Integer $samplingInterval, com.nutanix.dp1.net.common.v1.stats.DownSamplingOperator $statType, String $select, HashMap ... args) throws RestClientException {
// Check for optional argument map
HashMap argMap = args.length > 0 ? args[0] : new HashMap();
Object postBody = null;
// verify the required parameter 'vpcUuid' is set
if (vpcUuid == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'vpcUuid' when calling getVpcNsStats");
}
// verify the required parameter 'extSubnetUuid' is set
if (extSubnetUuid == null) {
throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extSubnetUuid' when calling getVpcNsStats");
}
// create path and map variables
final Map uriVariables = new HashMap();
uriVariables.put("vpcUuid", vpcUuid);
uriVariables.put("extSubnetUuid", extSubnetUuid);
String path = UriComponentsBuilder.fromPath("/api/networking/v4.0.a1/stats/vpc/{vpcUuid}/external-subnets/{extSubnetUuid}").buildAndExpand(uriVariables).toUriString();
final MultiValueMap queryParams = new LinkedMultiValueMap();
final HttpHeaders headerParams = new HttpHeaders();
final MultiValueMap formParams = new LinkedMultiValueMap();
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$startTime", $startTime));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$endTime", $endTime));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$samplingInterval", $samplingInterval));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$statType", $statType));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$select", $select));
if (!CollectionUtils.isEmpty(argMap)) {
if (argMap.containsKey(HttpHeaders.IF_MATCH) && argMap.get(HttpHeaders.IF_MATCH)!=null) {
headerParams.add(HttpHeaders.IF_MATCH, apiClient.parameterToString(argMap.get(HttpHeaders.IF_MATCH)));
}
if (argMap.containsKey(HttpHeaders.IF_NONE_MATCH) && argMap.get(HttpHeaders.IF_NONE_MATCH)!=null) {
headerParams.add(HttpHeaders.IF_NONE_MATCH, apiClient.parameterToString(argMap.get(HttpHeaders.IF_NONE_MATCH)));
}
}
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);
}
}