All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nutanix.aio.java.client.api.StatsApi Maven / Gradle / Ivy

Go to download

Manage infrastructure on-premises and in the cloud seamlessly through AIOps features such as Analysis, Reporting, Capacity Planning, What if Analysis, VM Rightsizing, Troubleshooting, App Discovery, Broad Observability, and Ops Automation through Playbooks.

The newest version!
package com.nutanix.aio.java.client.api;

import com.nutanix.aio.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-18T04:04:16.151Z[Etc/UTC]")@Component("com.nutanix.aio.java.client.api.StatsApi")
public class StatsApi {
    private ApiClient apiClient;
	private final Set headersToSkip;

    public StatsApi() {
        this(new ApiClient());
    }

    @Autowired
    public StatsApi(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;
    }

    /**
     * Returns entity and metrics descriptors.
     * 

200 - Successfully returns all entity descriptors. *

4XX - Client error response *

5XX - Server error response * @param extId The UUID of a source. * @param $page A URL query parameter that specifies the page number of the result set. Must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range will lead to no results being returned. * @param $limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided a default value of 50 records will be returned in the result set. * @param $filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. * For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter result on cluster name karbon-ntnx1.0, filter '$filter=startswith(name, 'C')' would filter on cluster name starting with C. * The filter can be applied on the following fields: *

    *
  • entityType
  • *
  • metrics/name
  • *
* @param args Additional arguments * @return com.nutanix.dp1.aio.aiops.v4.stats.EntityDescriptorListApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.aio.aiops.v4.stats.EntityDescriptorListApiResponse getEntityDescriptorsV4(String extId, Integer $page, Integer $limit, String $filter, 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 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling getEntityDescriptorsV4"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/aiops/v4.0.a2/stats/sources/{extId}/entity-descriptors").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$page", $page)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$limit", $limit)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$filter", $filter)); 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); } /** * Returns attribute/metric data for the selected entities. *

200 - Successfully returns all the entities. *

4XX - Client error response *

5XX - Server error response * @param sourceExtId The UUID of a source. * @param extId The UUID of an entity type. * @param $page A URL query parameter that specifies the page number of the result set. Must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range will lead to no results being returned. * @param $limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided a default value of 50 records will be returned in the result set. * @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 $filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. * For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter result on cluster name karbon-ntnx1.0, filter '$filter=startswith(name, 'C')' would filter on cluster name starting with C. * The filter can be applied on the following fields: *

    *
  • extId
  • *
  • metrics/name
  • *
  • metrics/timeSeries/values/value
  • *
* @param $orderby A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in desc order. * The orderby can be applied to the following fields: *
    *
  • extId
  • *
* @param args Additional arguments * @return com.nutanix.dp1.aio.aiops.v4.stats.EntityListApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.aio.aiops.v4.stats.EntityListApiResponse getEntityMetricsV4(String sourceExtId, String extId, Integer $page, Integer $limit, String $startTime, String $endTime, Integer $samplingInterval, com.nutanix.dp1.aio.common.v1.stats.DownSamplingOperator $statType, String $filter, String $orderby, 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 'sourceExtId' is set if (sourceExtId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'sourceExtId' when calling getEntityMetricsV4"); } // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling getEntityMetricsV4"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("sourceExtId", sourceExtId); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/aiops/v4.0.a2/stats/sources/{sourceExtId}/entities/{extId}").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$page", $page)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$limit", $limit)); 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, "$filter", $filter)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$orderby", $orderby)); 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); } /** * Returns a list of available entity types for a given source. *

200 - Successfully returns all the entity types. *

4XX - Client error response *

5XX - Server error response * @param extId The UUID of a source. * @param args Additional arguments * @return com.nutanix.dp1.aio.aiops.v4.stats.EntityTypeListApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.aio.aiops.v4.stats.EntityTypeListApiResponse getEntityTypesV4(String extId, 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 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling getEntityTypesV4"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/aiops/v4.0.a2/stats/sources/{extId}/entity-types").buildAndExpand(uriVariables).toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); 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); } /** * Returns a list of available sources. *

200 - Successfully returns all the sources. *

4XX - Client error response *

5XX - Server error response * @param args Additional arguments * @return com.nutanix.dp1.aio.aiops.v4.stats.SourceListApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.aio.aiops.v4.stats.SourceListApiResponse getSourcesV4(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/aiops/v4.0.a2/stats/sources").build().toUriString(); final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); 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); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy