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

com.nutanix.vmm.java.client.api.EsxiVmApi Maven / Gradle / Ivy

package com.nutanix.vmm.java.client.api;

import com.nutanix.vmm.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:46:19.074Z[Etc/UTC]")@Component("com.nutanix.vmm.java.client.api.EsxiVmApi")
public class EsxiVmApi {
    private ApiClient apiClient;
	private final Set headersToSkip;

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

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

    /**
     * Assign the owner of a Virtual Machine.
     * 

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of an instance. It should be of type UUID. * @param body The body parameter * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssignVmOwnerResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssignVmOwnerResponse assignVmOwner(String extId, com.nutanix.dp1.vmm.vmm.v4.esxi.config.OwnershipInfo body, HashMap ... args) throws RestClientException { // Check for optional argument map HashMap argMap = args.length > 0 ? args[0] : new HashMap(); Object postBody = body; // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling assignVmOwner"); } // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling assignVmOwner"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/$actions/assign-owner").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 = { "application/json" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "basicAuthScheme" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Associate categories to a Virtual Machine. *

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of an instance. It should be of type UUID. * @param body The body parameter * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssociateVmCategoriesResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssociateVmCategoriesResponse associateVmCategories(String extId, com.nutanix.dp1.vmm.vmm.v4.esxi.config.AssociateVmCategoriesParams body, HashMap ... args) throws RestClientException { // Check for optional argument map HashMap argMap = args.length > 0 ? args[0] : new HashMap(); Object postBody = body; // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling associateVmCategories"); } // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling associateVmCategories"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/$actions/associate-categories").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 = { "application/json" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "basicAuthScheme" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Disassociate categories from a Virtual Machine. *

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of an instance. It should be of type UUID. * @param body The body parameter * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.DisassociateVmCategoriesResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.DisassociateVmCategoriesResponse disassociateVmCategories(String extId, com.nutanix.dp1.vmm.vmm.v4.esxi.config.DisassociateVmCategoriesParams body, HashMap ... args) throws RestClientException { // Check for optional argument map HashMap argMap = args.length > 0 ? args[0] : new HashMap(); Object postBody = body; // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling disassociateVmCategories"); } // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling disassociateVmCategories"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/$actions/disassociate-categories").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 = { "application/json" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "basicAuthScheme" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Retrieves the Nutanix Guest Tools configuration for a Virtual Machine. *

200 - Success. *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of a VM. It should be of type UUID. * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.GetNutanixGuestToolsResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.GetNutanixGuestToolsResponse getNutanixGuestTools(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 getNutanixGuestTools"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/nutanix-guest-tools").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); } /** * Retrieves configuration details for a Virtual Machine. *

200 - Success. *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of an instance. It should be of type UUID. * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.GetVmResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.GetVmResponse getVm(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 getVm"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}").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); } /** * Inserts the Nutanix Guest Tools installation and configuration ISO into a virtual machine. *

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of a VM. It should be of type UUID. * @param body The body parameter * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.InsertNutanixVmGuestToolsResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.InsertNutanixVmGuestToolsResponse insertNutanixVmGuestTools(String extId, com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestToolsInsertConfig body, HashMap ... args) throws RestClientException { // Check for optional argument map HashMap argMap = args.length > 0 ? args[0] : new HashMap(); Object postBody = body; // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling insertNutanixVmGuestTools"); } // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling insertNutanixVmGuestTools"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/insert-iso").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 = { "application/json" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "basicAuthScheme" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Installs Nutanix Guest Tools in a Virtual Machine by using the provided credentials. *

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of a VM. It should be of type UUID. * @param body The body parameter * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.InstallNutanixVmGuestToolsResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.InstallNutanixVmGuestToolsResponse installNutanixVmGuestTools(String extId, com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestToolsInstallConfig body, HashMap ... args) throws RestClientException { // Check for optional argument map HashMap argMap = args.length > 0 ? args[0] : new HashMap(); Object postBody = body; // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling installNutanixVmGuestTools"); } // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling installNutanixVmGuestTools"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/install").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 = { "application/json" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "basicAuthScheme" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Lists the Virtual Machines defined on the system. List of Virtual Machines can be further filtered out using various filtering options. *

200 - Success. *

4XX - Client error response *

5XX - Server error response * @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: *

    *
  • cluster/extId
  • *
  • host/extId
  • *
  • name
  • *
* @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: *
    *
  • name
  • *
* @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.ListVmsResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.ListVmsResponse listVms(Integer $page, Integer $limit, 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; String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms").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)); 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); } /** * Trigger an in-guest uninstallation of Nutanix Guest Tools. *

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of a VM. It should be of type UUID. * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.UninstallNutanixVmGuestToolsResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.UninstallNutanixVmGuestToolsResponse uninstallNutanixVmGuestTools(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 uninstallNutanixVmGuestTools"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/uninstall").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.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Updates the Nutanix Guest Tools configuration for a Virtual Machine. *

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of a VM. It should be of type UUID. * @param body The body parameter * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.UpdateNutanixGuestToolsResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.UpdateNutanixGuestToolsResponse updateNutanixGuestTools(String extId, com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestTools body, HashMap ... args) throws RestClientException { // Check for optional argument map HashMap argMap = args.length > 0 ? args[0] : new HashMap(); Object postBody = body; // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling updateNutanixGuestTools"); } // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling updateNutanixGuestTools"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/nutanix-guest-tools").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 = { "application/json" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "basicAuthScheme" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } /** * Trigger an in-guest upgrade of Nutanix Guest Tools. *

202 - Request Accepted *

4XX - Client error response *

5XX - Server error response * @param extId Globally unique identifier of a VM. It should be of type UUID. * @param body The body parameter * @param args Additional arguments * @return com.nutanix.dp1.vmm.vmm.v4.esxi.config.UpgradeNutanixVmGuestToolsResponse * @throws RestClientException if an error occurs while attempting to invoke the API */ public com.nutanix.dp1.vmm.vmm.v4.esxi.config.UpgradeNutanixVmGuestToolsResponse upgradeNutanixVmGuestTools(String extId, com.nutanix.dp1.vmm.vmm.v4.esxi.config.NutanixGuestToolsUpgradeConfig body, HashMap ... args) throws RestClientException { // Check for optional argument map HashMap argMap = args.length > 0 ? args[0] : new HashMap(); Object postBody = body; // verify the required parameter 'extId' is set if (extId == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'extId' when calling upgradeNutanixVmGuestTools"); } // verify the required parameter 'body' is set if (body == null) { throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling upgradeNutanixVmGuestTools"); } // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("extId", extId); String path = UriComponentsBuilder.fromPath("/api/vmm/v4.0.a1/esxi/config/vms/{extId}/nutanix-guest-tools/$actions/upgrade").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 = { "application/json" }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "basicAuthScheme" }; ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy