
com.nutanix.sec.java.client.api.STIGsApi Maven / Gradle / Ivy
Show all versions of security-java-client Show documentation
package com.nutanix.sec.java.client.api;
import com.nutanix.sec.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.core.io.InputStreamResource;
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.*;
@lombok.extern.slf4j.Slf4j
@javax.annotation.Generated(value = "com.nutanix.swagger.codegen.generators.JavaClientSDKGenerator", date = "2024-12-05T00:55:59.712Z[Etc/UTC]")@Component("com.nutanix.sec.java.client.api.STIGsApi")
public class STIGsApi {
private ApiClient apiClient;
private final Set headersToSkip;
public STIGsApi() {
this(new ApiClient());
}
@Autowired
public STIGsApi(ApiClient apiClient) {
this.apiClient = apiClient;
this.headersToSkip = new HashSet<>(Arrays.asList("authorization", "cookie", "host", "user-agent"));
}
public ApiClient getApiClient() {
return apiClient;
}
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Fetch the current number of issues found by STIG for each cluster.
* 200 - Returns the requested aggregate report of the STIG scan.
*
4XX - Client error response
*
5XX - Server error response
* @param $page A URL query parameter that specifies the page number of the result set. It 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 might lead to no results.
* @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](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions.
* For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the 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 to the following fields:
*
* - clusterExtId
*
* @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 descending order.
* The orderby can be applied to the following fields:
*
* - clusterExtId
* - failedCount
* - notApplicableCount
* - passedCount
*
* @param $expand A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported.
- cluster
* @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](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) 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.
- clusterExtId
- extId
- failedCount
- links
- notApplicableCount
- passedCount
- tenantId
* @param args Additional arguments
* @return com.nutanix.dp1.sec.security.v4.report.ListStigSummariesApiResponse
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public com.nutanix.dp1.sec.security.v4.report.ListStigSummariesApiResponse listStigSummaries(Integer $page, Integer $limit, String $filter, String $orderby, String $expand, String $select, Map ... args) throws RestClientException {
// Check for optional argument map
Map argMap = args.length > 0 ? args[0] : new HashMap();
Object postBody = null;
String uriPath = UriComponentsBuilder.fromPath("/api/security/v4.0.b1/report/stig-summaries").build().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));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$orderby", $orderby));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$expand", $expand));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$select", $select));
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[] { "apiKeyAuthScheme", "basicAuthScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(uriPath, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
/**
* Fetch the STIG controls details for STIG rules on each cluster.
* 200 - Returns the STIG controls details.
*
4XX - Client error response
*
5XX - Server error response
* @param $page A URL query parameter that specifies the page number of the result set. It 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 might lead to no results.
* @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](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions.
* For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the 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 to the following fields:
*
* - severity
* - status
*
* @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 descending order.
* The orderby can be applied to the following fields:
*
* - severity
* - stigVersion
*
* @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](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) 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.
- affectedClusters
- benchmarkId
- comments
- extId
- fixText
- identifiers
- links
- ruleId
- severity
- status
- stigVersion
- tenantId
- title
* @param args Additional arguments
* @return com.nutanix.dp1.sec.security.v4.report.ListStigsApiResponse
* @throws RestClientException if an error occurs while attempting to invoke the API
*/
public com.nutanix.dp1.sec.security.v4.report.ListStigsApiResponse listStigs(Integer $page, Integer $limit, String $filter, String $orderby, String $select, Map ... args) throws RestClientException {
// Check for optional argument map
Map argMap = args.length > 0 ? args[0] : new HashMap();
Object postBody = null;
String uriPath = UriComponentsBuilder.fromPath("/api/security/v4.0.b1/report/stigs").build().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));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$orderby", $orderby));
queryParams.putAll(apiClient.parameterToMultiValueMap(null, "$select", $select));
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[] { "apiKeyAuthScheme", "basicAuthScheme" };
ParameterizedTypeReference returnType = new ParameterizedTypeReference() {};
return apiClient.invokeAPI(uriPath, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType);
}
}